Example of a shell task

nRF Connect for VS Code

tags
nRF Connect for VS Code

In the following example, the tasks.json file includes a custom nrf-connect-shell type called my-shell, which executes the command env in a shell (that has all the environment settings inherited from the system) and sets the env_variable to value_1 for this shell:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "nrf-connect-shell",
      "label": "my-shell",
      "command": "env",
      "cwd": "${activeConfig}",
      "env": {
        "env_variable": "value_1"
      }
    }
  ]
}