Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordomenic <domenic@domenicdenicola.com>2012-05-29 02:21:44 +0400
committerisaacs <i@izs.me>2012-06-18 05:02:48 +0400
commit391b8a3239710efaa9089dab8d5e2b2f25e19b6b (patch)
tree8d426f97533f75dcfb5e9970c66ba3c07e024651 /test
parent59dda0bcdb89a9da88d1efd531a8f2b05b570f23 (diff)
Quote paths passed to child_process.exec.
This is necessary on Windows; otherwise you get 2> 'c:\PROGRAM' is not recognized as an internal or external command, 2> operable program or batch file. since Node/npm are in "C:\Program Files (x86)\nodejs", which has spaces in it.
Diffstat (limited to 'test')
-rw-r--r--test/run.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/run.js b/test/run.js
index c864450ab..86f6704b3 100644
--- a/test/run.js
+++ b/test/run.js
@@ -72,8 +72,8 @@ 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 + " ")
+ cmd = cmd.replace(/^npm /, "\"" + path.resolve(npmPath, "npm") + "\" ")
+ cmd = cmd.replace(/^node /, "\"" + process.execPath + "\" ")
child_process.exec(cmd, {env: env}, function (er, stdout, stderr) {
if (stdout) {