Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97445

Visual Studio Code, Tasks not asinging input variable, parsing a command

$
0
0

I'm trying to make a task build code for ESPRESSIF IDF natively in VSCode on Linux (Ubuntu 10) but I'm running into some issue with the following task:

    // 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" }
        ]
}

But I getting the following error:

input variable 'variable' can only be of type 'prompt String', 'pickString', or 'command'.

The expected behavior was to assign the parsed output of ls /dev/tty* | grep USB like /dev/ttyUSB0 to setPort and in term pass a command like idf.py -p /dev/ttyUSB0 flash as part or the build process.

Any pointers will be greatly appreciated. (BTW, No, I don't what to use platfromIO :))


Viewing all articles
Browse latest Browse all 97445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>