-2

Git Bash Output

"code-runner.terminalRoot":"/",
"code-runner.executorMap": {
"cpp": "cd $dirWithoutTrailingSlash && g++ -std=c++14 -O2 -Wall $fileName -o $fileNameWithoutExt && ./$fileNameWithoutExt"
}

These are my settings.json which when i try to run on windows 10(vscode gitbash) gives the error above, i've changed it to many ways, but it seems not working, can you help.

  • 1
    Does this answer your question? [VSCode: Code Runner extension is unable to execute the code on git bash terminal?](https://stackoverflow.com/questions/62721028/vscode-code-runner-extension-is-unable-to-execute-the-code-on-git-bash-terminal) – SwissCodeMen May 31 '21 at 21:21
  • No, i've already checked the post. – Shadab Eqbal May 31 '21 at 21:22
  • 1
    Please [don’t post images of code, error messages, or other textual data.](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors) – tripleee Jun 01 '21 at 04:43

1 Answers1

1

The syntax you are using is not bash.

Try something like

if [[ $? -eq 0 ]]
then
   ...
fi
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134