-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix node.cmd white space paths #51
Conversation
Paths with blanks for the node command are note processed correctly (see nyc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind taking a look at why Windows tests are failing?
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "spawn-wrap", | |||
"version": "1.3.4", | |||
"version": "1.3.5-a", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to bump the version, we can do this when we release the update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -150,11 +150,15 @@ function mungeCmd (workingDir, options) { | |||
|
|||
var m = command.match(re) | |||
var replace | |||
var nodeCmd = workingDir + '/node.cmd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be \\node.cmd
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily. afaik, JS on windows can parse "/" paths properly. One can use e.g. the "path" package:
var path = require("path");
var absolutePath = path.resolve("Relative file path");
@@ -150,11 +150,15 @@ function mungeCmd (workingDir, options) { | |||
|
|||
var m = command.match(re) | |||
var replace | |||
var nodeCmd = workingDir + '/node.cmd' | |||
if(workingDir.indexOf(' ') !== -1) { | |||
nodeCmd = ' "' + nodeCmd + '"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to not just always wrap the nodeCmd
in quotes for Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I don't think there are side-effects.
What's the status of this? Seems like this should fix #69, which currently prevents me from getting coverage with |
I believe this issue has been addressed by other PR's for the 2.x release line. |
If node.cmd is in a path with white spaces (e.g. nyc run on windows where the user home has a space in it), the command fails with ENOENT. This should fix it.