在Ubuntu 18.04上使用Visual Studio Code 1.39.2。 Visual Studio Code documentation for Input variables显示了一个从列表中选择名称的示例。通过定义这样的输入:
"id": "pickFromList","type": "pickString","description": "What folder do you want to create?","options": [
"dirOption1","dirOption2","dirOption3"
],"default": "dirOption1"
现在可以使用选择在任务中创建文件夹:
"label": "Create folder by 'pickString' input","type": "shell","command": "mkdir","args": [
"${workspaceFolder}/${input:pickFromList}"
]
好!该文档说有一个通用的command
类型,但是没有提供示例。我尝试了一下,但没有成功,应该会生成一个16个字符的随机字符串(使用命令openssl rand -base64 32 | tr -d /=+ | cut -c -1
从bash运行):
"id": "randomString","type": "command","command": "openssl","args": [
"rand","-base64","32","| tr -d /=+ | cut -c -16)"
]
经过数小时的搜索,我找不到使用command
类型输入的单个工作示例!这真的有效吗?
预先感谢...