Reputation: 1
I have a problem when I try to run a make task that runs in a windows command shell. I've tried various combinations but I can't get the command to fully execute.
In tasks.json below you can see I've tried various methods (this format gives me the most info) but in all attempts the make file command fails "'make' is not recognized as an internal or external command, operable program or batch file." yet its the script setCmdEnv in the first command which sets up the make path etc. The first two commands work fine, I can't see why the last command doesn't execute correctly. Weirdly I can type make after the shell is loaded (after the error) and all is ok.
{
"version": "2.0.0",
"type":"shell",
"windows": {
"options": {
"shell": {
// "executable": "C:\\WINDOWS\\System32\\cmd.exe",
"executable": "",
// "args": [
// "/K .\\BuildEnv\\xBuildEnv\\setCmdEnv && cd .\\app && "
// ]
}
}
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"clear": false
},
"tasks": [
{
"label": "Make %1.test",
"command": "cmd.exe",
"args": [
" /K .\\BuildEnv\\xBuildEnv\\setCmdEnv && cd .\\app && make ${fileBasenameNoExtension}.test"
],
"problemMatcher": []
}
],
}
Upvotes: 0
Views: 162
Reputation: 191
I had a similar issue and to make the Visual Studio Code task to execute multiple commands, I had to separate each elements of the args
array to leave out any white space. So in this case, the task could be something like this:
{
"version": "2.0.0",
"tasks": [
{
"label": "Make your test file",
"type": "shell",
"windows": {
"command": "%comspec%",
"args": ["/C", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat",
"&&", "cd", ".\\apps", "&&", "make", "${fileBasenameNoExtension}.test"
]
},
"options": {
"cwd": "${workspaceRoot}"
},
"presentation": {
"showReuseMessage": false,
"reveal": "always",
"panel": "shared",
"group": "test",
"clear": true,
"focus": true
}
}
]
}
Note: The %comspec%
variable resolves to C:\WINDOWS\system32\cmd.exe
.
Upvotes: 2