nativescript-community / nativescript-vscode-extension

A Visual Studio Code Extension for NativeScript
https://www.nativescript.org/visual-studio-code
Apache License 2.0
82 stars 32 forks source link

execSync crashes process with custom shell on Windows #121

Closed petekanev closed 7 years ago

petekanev commented 7 years ago

Changes introduced with PR https://github.com/NativeScript/nativescript-vscode-extension/pull/118 cause a crash on Windows when a non default shell is used (git bash).

Mine is located in C:/Program Files/Git/.... for example, and the path contains whitespaces, resulting in the following error output:

[NativeScriptCli] execute: tns --version
Error: Command failed: tns --version
/c/Program: Files\Git\usr\bin\bash: No such file or directory
Error: NativeScript CLI not found. Use 'nativescript.tnsPath' workspace setting to explicitly set the absolute path to the NativeScript CLI.

It is a known node.js issue - https://github.com/nodejs/node/issues/6803

petekanev commented 7 years ago

I propose a fix for Windows that will always default to the cmd.exe (just as it has been before 0.7).

I have not tested whether having a whitespace in the path to the default shell on a Unix OS will produce the same node error, though based on the original node issue - it should.