diff options
-rw-r--r-- | lib/utils/exec.js | 5 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/exec.js b/lib/utils/exec.js index 5bdc512f2..d7f7108b6 100644 --- a/lib/utils/exec.js +++ b/lib/utils/exec.js @@ -30,6 +30,7 @@ function exec (cmd, args, env, takeOver, cb) { function logger (d) { if (d) process.binding("stdio").writeError(d+"") } function pipe (cp1, cp2, cb) { sys.pump(cp1.stdout, cp2.stdin) + var errState = null if (log.level <= log.LEVEL.silly) { cp1.stderr.on("data", logger) cp2.stderr.on("data", logger) @@ -37,9 +38,11 @@ function pipe (cp1, cp2, cb) { cp1.on("exit", function (code) { if (!code) return log.verbose(cp2.name || "<unknown>", "success") cp2.kill() - cb(new Error( "Failed "+(cp1.name || "<unknown>")+"\nexited with "+code)) + cb(errState = new Error( + "Failed "+(cp1.name || "<unknown>")+"\nexited with "+code)) }) cp2.on("exit", function (code) { + if (errState) return if (!code) return log.verbose(cp1.name || "<unknown>", "success", cb) cb(new Error( "Failed "+(cp2.name || "<unknown>")+"\nexited with "+code)) }) diff --git a/package.json b/package.json index 2580f52e4..8e2c62670 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "npm" , "description" : "A package manager for node" -, "version" : "0.1.27-2" +, "version" : "0.1.27-3" , "homepage" : "http://npmjs.org/" , "author" : "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)" , "contributors" : |