wk-j / vscode-save-and-run

Visual Studio Code extension to run commands whenever a file is saved https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run
Apache License 2.0
32 stars 7 forks source link

Doesn't work when default terminal is BASH #37

Closed khanzzirfan closed 4 years ago

khanzzirfan commented 5 years ago

When bash is the default terminal, the workspace folder looses all the '//' for folders. All the path variables looses '//'.

raschmitt commented 4 years ago

Same issue here.

I've solved it by enclosing my file directory in quotes, like this:

"saveAndRun": {
    "commands": [
      {
        "match": ".go",
        "cmd": "cd \"${fileDirname}\"",
        "useShortcut": false,
        "silent": false
      },
      {
        "match": ".go",
        "cmd": "go run .",
        "useShortcut": false,
        "silent": false
      }
    ]
  }

Maybe it would be interesting if this was a default behavior from the extension.

khanzzirfan commented 4 years ago

Solves the problem. Thanks