-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. any reason to not just always wrap the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. I don't think there are side-effects. |
||
} | ||
if (m) { | ||
options.originalNode = m[2] | ||
replace = m[1] + workingDir + '/node.cmd' + m[3] + m[4] | ||
options.args[cmdi + 1] = m[1] + m[2] + m[3] + | ||
' "' + workingDir + '\\node"' + m[4] | ||
nodeCmd + m[4] | ||
} else { | ||
// XXX probably not a good idea to rewrite to the first npm in the | ||
// path if it's a full path to npm. And if it's not a full path to | ||
|
@@ -165,7 +169,7 @@ function mungeCmd (workingDir, options) { | |
|
||
var npmPath = whichOrUndefined('npm') || 'npm' | ||
npmPath = path_.dirname(npmPath) + '\\node_modules\\npm\\bin\\npm-cli.js' | ||
replace = m[1] + workingDir + '/node.cmd' + | ||
replace = m[1] + nodeCmd + | ||
' "' + npmPath + '"' + | ||
m[3] + m[4] | ||
options.args[cmdi + 1] = command.replace(npmre, replace) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
"description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.", | ||
"main": "index.js", | ||
"dependencies": { | ||
|
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: