Browse files

Surround npm/node paths with quotes on Windows.

Allows tests to run there.
  • Loading branch information...
1 parent 065d1a9 commit 1310c816906ec851fb7b60be8f76285b790e2125 @domenic domenic committed with isaacs Sep 14, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 test/run.js
View
10 test/run.js
@@ -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 1310c81

Please sign in to comment.