Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 使用类型为“的输入”;“命令”;在tasks.json中_Visual Studio Code_Task - Fatal编程技术网

Visual studio code 使用类型为“的输入”;“命令”;在tasks.json中

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

在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": "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)"
]