Closed Lutier2017 closed 4 years ago
Yes, it's possible to config default working directory for all the runOnSave.commands
or for each. The possible way is to add a runOnSave.defaultWorkingDirectory
option or add a workingDirectory
for each comment.
Give your suggestions, Thanks.
Hi, I think when you are developing a project, everything is in the project folder : ${workspaceFolder}. If you need any other stuff from another project, you copy/paste it in your project. Think about this:
From above description, I believe runOnSave.defaultWorkingDirectory
is not required. IN FACT, "Run On Save" should execute any command BY DEFAULT in ${workspaceFolder}.
I believe, workingDirectory
per command is the choice that "Run On Save" should include. Because, when you develop your project, you may need to develop stuff in other sub-project, or in a sub-folder of ${workspaceFolder}.
I appreciate your reply.
Thanks for your explanation, I believe this is a good idea and will not make any trouble. I will work on it later.
I added a new option workingDirectoryAsCWD
, you may set it to true
to make CWD to be vscode working directory.
workingDirectoryAsCWD
default value is true
, nothing needs to change by default.
Hi, Normally I have all scripts to run in the ${workspaceFolder}. I noticed that any command ("runOnSave.commands": [ ]) is always run in Windows 7 from folder:
I mean, for the running script ${cwd} is as indicated above.
This is making me to invest additional effort to indicate the right folder of my scripts.
QUESTION: Is there a way to make any commands to run from ${workspaceFolder} instead?
I appreciate a reply.
This is my "settings.json" file
Please see system information below:
SYSTEM: Windows 7
VSCODE: Version: 1.48.2 (user setup) Commit: a0479759d6e9ea56afa657e454193f72aef85bd0 Date: 2020-08-25T10:13:11.295Z Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 6.1.7601
$ git --version git version 2.28.0.windows.1
$ bash --version GNU bash, version 4.4.23(1)-release (x86_64-pc-msys) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html