Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Surround npm/node paths with quotes on Windows.

Allows tests to run there.
  • Loading branch information...
commit efd300b6864a510eb61d38b126b4bb9ac75f7172 1 parent ef0ba6a
@domenic domenic authored
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) {
Please sign in to comment.
Something went wrong with that request. Please try again.