Visual studio code 使用类型为“的输入”;“命令”;在tasks.json中
在Ubuntu 18.04上使用Visual Studio代码1.39.2。显示了从列表中选择名称的示例。通过定义如下输入:Visual studio code 使用类型为“的输入”;“命令”;在tasks.json中,visual-studio-code,task,Visual Studio Code,Task,在Ubuntu 18.04上使用Visual Studio代码1.39.2。显示了从列表中选择名称的示例。通过定义如下输入: "id": "pickFromList", "type": "pickString", "description": "What folder do you want to create?", "options": [ "dirOption1", "dirOption2", "dirOption3" ], "default": "dirOption
"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}"
]
很好!文档中说有一个通用的命令
类型,但没有提供示例。我尝试了这个方法,但没有成功,它应该生成一个16个字符的随机字符串(这可以从bash使用命令openssl rand-base64 32 | tr-d/=+| cut-c-1
):
经过数小时的搜索,我找不到一个使用command
type输入的工作示例!这真的有效吗
先谢谢你
"id": "randomString",
"type": "command",
"command": "openssl",
"args": [
"rand",
"-base64",
"32",
"| tr -d /=+ | cut -c -16)"
]