W
W
webkadiz2020-05-13 18:03:39
Visual Studio Code
webkadiz, 2020-05-13 18:03:39

Is it possible to run two shell commands in one task in Visual Studio Code?

There is such a task (in the picture below). It compiles cpp file.

{
      "type": "shell",
      "label": "g++.exe build active file",
      "command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\g++.exe",
      "args": [
        "-g",
        "'${file}'",
        "-o",
        "'${fileDirname}\\${fileBasenameNoExtension}.exe'",
      ],
      "options": {
        "cwd": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin"
      },
      "problemMatcher": [
        "$gcc"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },

The question is: is it possible to make the task both compile the file and then run it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yerumaku, 2020-11-21
@Yerumaku

Yes, you can .

"dependsOrder": "parallel", // или "sequence"
"dependsOn": [ "Имя задачи 1", "Имя задачи 2" ]

It is understood that each team has its own task (and expected response), and the tasks themselves can be linked to each other in chains, parallelizing if possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question