Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths contain slash delimiters in project-a, but are missing slash delimiters in project-b. #55

Open
cagross opened this issue May 15, 2021 · 0 comments

Comments

@cagross
Copy link

cagross commented May 15, 2021

Summary

If I add the statement console.log(process.argv) to a JS file (file-changed.js), then have Run on Save execute that file, it prints the first two paths with escaped slashes, but the third path without any slashes at all. How can I fix this? The full output of the console.log statement is:

[
  'C:\\Program Files\\nodejs\\node.exe',
  'c:\\Users\\66851\\development\\projectb\\file-changed.js',
  'c:Users66851developmentprojectbtest-file.js'
]

Details

I have two different Node projects on my computer, both with Run on Save installed an in-use: projecta and projectb. In projecta, the output from Run on Save is as desired/expected. But in projectb, it is not.

Both projects have this configuration

  • Run on Save v0.2.0

  • I created a JS file in my project's root directory (file-changed.js) and to it added only this statement:

console.log(process.argv)

  • I configured Run on Save to execute this file whenever any other file was saved. My Run on Save entry in .vscode/settings.js is:
  "emeraldwalk.runonsave": {
    "commands": [
      {
        "cmd": "node file-changed.js ${file}"
      }
    ],

projecta has expected results

In projecta, if I save the file test-file.js, Run on Save executes filechanged.js, and prints this expected output to the console:

[
'C:\Program Files\nodejs\node.exe',
'c:\Users\66851\development\projecta\tasks\orbis-file-changed.js',
'c:\Users\66851\development\projecta\test-file.js'
]

Each path is separated with escaped slashes, as desired/expected.

projectb has unexpected results

In projectb, if I carry out the same test, the output is a little different:

[
  'C:\\Program Files\\nodejs\\node.exe',
  'c:\\Users\\66851\\development\\projectb\\file-changed.js',
  'c:Users66851developmentprojectbtest-file.js'
]

The last path is missing slashes. Why is there this discrepancy between the two projects? This is causing issues for me because I need that path to be separated with slashes (or some other delimiter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant