Visual studio code Visual Studio代码,任务不是输入变量,解析命令

Visual studio code Visual Studio代码,任务不是输入变量,解析命令,visual-studio-code,Visual Studio Code,我试图在Linux(Ubuntu10)上的VSCode中为ESPRESSIF IDF本机生成一个任务构建代码,但在以下任务中遇到了一些问题: // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "la

我试图在Linux(Ubuntu10)上的VSCode中为ESPRESSIF IDF本机生成一个任务构建代码,但在以下任务中遇到了一些问题:

    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build Firmware",
            "group": "build",
            "type": "shell",
            "command": "idf.py",
            "args": ["build"],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }    
        },

        {
            "label": "Flash Firmware",
            "group": "build",
            "type": "shell",
            "command": "idf.py",
            "args": ["-p","${input:setPort}","flash"],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }    
        }
    ],
    "inputs": [
        {
          "id": "setPort",
          "type" : "command",
          "command": "ls /dev/tty* | grep USB" }
        ]
}
但我得到了以下错误:

input variable 'variable' can only be of type 'prompt String', 'pickString', or 'command'.
预期的行为是将
ls/dev/tty*| grep USB的解析输出分配给
/dev/ttyUSB0
setPort,并在构建过程中传递idf.py-p/dev/ttyUSB0 flash等命令

任何指点都将不胜感激。(顺便说一句,不,我不知道如何使用platfromIO:)

因为
${input:var}
只接受以下内容:

目前VS代码支持三种类型的输入变量:

promptString:显示从用户处获取字符串的输入框。 pickString:显示一个快速拾取下拉列表,让用户从多个选项中进行选择。 命令:运行任意命令。 每种类型都需要其他配置属性:

提示字符串:

描述:显示在快速输入中,为输入提供上下文。 默认值:如果用户不输入其他内容,将使用的默认值。 选取字符串:

描述:显示在快速拾取中,为输入提供上下文。 选项:供用户选择的选项数组。 默认值:如果用户不输入其他内容,将使用的默认值。它必须是选项值之一。 命令:

命令:在变量插值上运行的命令。 args:传递给命令实现的可选选项包

重要的是要理解(这导致了我的错误)
command
type只支持VScode命令。这就是为什么它从未找到我的shell命令

大宗报价

大宗报价


嗨,我想知道是否有人有这个问题?我应该打开一个功能或问题吗?嗨,有人知道这里发生了什么吗?我刚刚试过:
“inputs”:[{“id”:“setPort”,“type”:“command”,“command”:“/usr/bin/ls”,“args”:[“/dev/tty*| grep USB”],}]
我还在项目根目录中创建了一个
getty.sh
脚本,并用命令替换了它,现在仍然是运行它的方式,它现在抱怨没有找到
ls
getty.sh
命令。您是否找到了实现所需的命令(即运行
ls
)?