Permalink
Browse files

Surround npm/node paths with quotes on Windows.

Allows tests to run there.
  • Loading branch information...
1 parent ef0ba6a commit efd300b6864a510eb61d38b126b4bb9ac75f7172 @domenic domenic committed Sep 14, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 test/run.js
View
@@ -72,8 +72,14 @@ function exec (cmd, shouldFail, cb) {
// special: replace 'node' with the current execPath,
// and 'npm' with the thing we installed.
var cmdShow = cmd
- cmd = cmd.replace(/^npm /, path.resolve(npmPath, "npm") + " ")
- cmd = cmd.replace(/^node /, process.execPath + " ")
+ var npmReplace = path.resolve(npmPath, "npm")
+ var nodeReplace = process.execPath
+ if (process.platform === "win32") {
+ npmReplace = '"' + npmReplace + '"'
+ nodeReplace = '"' + nodeReplace + '"'
+ }
+ cmd = cmd.replace(/^npm /, npmReplace + " ")
+ cmd = cmd.replace(/^node /, nodeReplace + " ")
child_process.exec(cmd, {env: env}, function (er, stdout, stderr) {
if (stdout) {

0 comments on commit efd300b

Please sign in to comment.