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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-05-02 22:46:30 +0400
committerisaacs <i@izs.me>2012-05-02 22:51:31 +0400
commitbbe8a9d3630df62853324f78053fe8c2f99a6f27 (patch)
tree610c6160611ee2715bb30510e6e14284ba5cc8df
parentc7327c6a70f908087b6f8db753beccd4aa56cba7 (diff)
Fix #2405 spawn on windows
-rw-r--r--lib/utils/exec.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/utils/exec.js b/lib/utils/exec.js
index 8b75adb24..2a803663f 100644
--- a/lib/utils/exec.js
+++ b/lib/utils/exec.js
@@ -36,7 +36,7 @@ function exec (cmd, args, env, takeOver, cwd, uid, gid, cb) {
log.verbose(new Error().stack, "stack at uid setting")
}
- if (isNaN(uid) || isNaN(gid)) {
+ if (uid && gid && (isNaN(uid) || isNaN(gid))) {
// get the numeric values
return uidNumber(uid, gid, function (er, uid, gid) {
if (er) return cb(er)
@@ -106,12 +106,8 @@ function spawn (c, a, env, takeOver, cwd, uid, gid) {
, cwd : cwd || null }
, cp
- if (!isNaN(uid)) opts.uid = uid
- if (!isNaN(gid)) opts.gid = gid
-
- if (!isNaN(opts.uid)) opts.uid = +opts.uid
-
- if (!isNaN(opts.gid)) opts.gid = +opts.gid
+ if (!isNaN(uid)) opts.uid = +uid
+ if (!isNaN(gid)) opts.gid = +gid
var name = c +" "+ a.map(JSON.stringify).join(" ")
log.silly([c, a, opts.cwd], "spawning")