vscode-code-runner
vscode-code-runner copied to clipboard
[Bug] -Windows shellscript executorMap not being honored.
- VS Code Version: 1.72.2
- OS Version: Windows 11
- Code Runner Version: v0.11.8
Describe the bug Trying to change how shellscripts run to be able to quickly use code runner. I've tried setting different options in settings but nothing changes.
"code-runner.executorMap": {
"shellscript": "cd $dir && sh $fileName",
}
To Reproduce Steps to reproduce the behavior:
- Set anything in executor map for shellscript
- Try to run a bash file
- Get the original message and settings are not honored.
Actual behavior Always get the EXACT same message, not matter how I change shellscript
[Running] /bin/bash "c:\workspace\test"
The system cannot find the path specified.
Expected behavior To be able to set variables and enable shellscripts to work with code runner.
I had the same question. But I solve it right now. Your script may have the "#!/bin/bash" at the first line which causes bash interpreter is fixed. So, the solution is just deleting the line. Then, your customed command can take effect instantly.
I just encountered the same problem and I removed "#!/bin/bash" then the code-runner will work like a charm. Thanks!
removed the line. still error below
(base) PS E:\code\open\ahks> bash "e:\code\open\ahks\publish.sh"
/bin/bash: e:codeopenahkspublish.sh: No such file or directory
and found code run config for bash is:
"shellscript": "bash ",
change to :
"shellscript": "bash $fileName",
it works