diff options
-rw-r--r-- | lib/utils/lifecycle.js | 2 | ||||
-rw-r--r-- | test/tap/lifecycle-path.js | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js index 12aff86d3..299fa5698 100644 --- a/lib/utils/lifecycle.js +++ b/lib/utils/lifecycle.js @@ -199,7 +199,7 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { var shFlag = "-c" if (process.platform === "win32") { - sh = "cmd" + sh = process.env.comspec || "cmd" shFlag = "/c" conf.windowsVerbatimArguments = true } diff --git a/test/tap/lifecycle-path.js b/test/tap/lifecycle-path.js index cf4bbdc99..dc05a15dc 100644 --- a/test/tap/lifecycle-path.js +++ b/test/tap/lifecycle-path.js @@ -6,11 +6,13 @@ var pkg = path.resolve(__dirname, "lifecycle-path") var fs = require("fs") var link = path.resolve(pkg, "node-bin") -// Without the path to the shell, nothing works usually. var PATH if (process.platform === "win32") { - PATH = "C:\\Windows\\system32;C:\\Windows" + // On Windows the 'comspec' environment variable is used, + // so cmd.exe does not need to be on the path. + PATH = "C:\\foo\\bar" } else { + // On non-Windows, without the path to the shell, nothing usually works. PATH = "/bin:/usr/bin" } |