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/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-10-03 04:28:50 +0400
committerisaacs <i@izs.me>2011-10-03 04:28:50 +0400
commit416c746743ae58b0e0d264b25da7ca1d5788b890 (patch)
treeed2d076eb3a0b1033a643c957f20684fbd2dbd0e /lib
parent8f9d4848afc177d4c758a4563da56b58db33949b (diff)
Windows is weird. Exec child procs with verbatim arguments
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/exec.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utils/exec.js b/lib/utils/exec.js
index 99049b5c8..47a2451e5 100644
--- a/lib/utils/exec.js
+++ b/lib/utils/exec.js
@@ -101,7 +101,13 @@ function spawn (c, a, env, takeOver, cwd, uid, gid) {
if (gid != null) opts.gid = gid
if (!isNaN(opts.uid)) opts.uid = +opts.uid
if (!isNaN(opts.gid)) opts.gid = +opts.gid
+ var name = c +" "+ a.map(JSON.stringify).join(" ")
+ if (process.platform === "win32") {
+ opts.windowsVerbatimArguments = true
+ a = ["/s", "/c", '"' + c + " " + a.join(" ") + '"']
+ c = "cmd.exe"
+ }
cp = child_process.spawn(c, a, opts)
- cp.name = c +" "+ a.map(JSON.stringify).join(" ")
+ cp.name = name
return cp
}