From 37d96e238d19683c734683801f09d72ce347418f Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 20 Apr 2015 12:42:31 -0400 Subject: [PATCH] Fix logical issue in update command --- build/actions/update.js | 2 +- lib/actions/update.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/actions/update.js b/build/actions/update.js index b04f0b53..1685e24c 100644 --- a/build/actions/update.js +++ b/build/actions/update.js @@ -36,7 +36,7 @@ }; command = "npm install --global " + packageJSON.name; return child_process.exec(command, function(error, stdout, stderr) { - if (error != null) { + if (error == null) { return onUpdate(null, stdout, stderr); } if (_.any([error.code === 3, error.code === 'EPERM', error.code === 'ACCES'])) { diff --git a/lib/actions/update.coffee b/lib/actions/update.coffee index 20d669b2..1ca7b5ee 100644 --- a/lib/actions/update.coffee +++ b/lib/actions/update.coffee @@ -41,7 +41,7 @@ exports.update = # A safer thing to do is to call npm as a child process # https://github.com/npm/npm/issues/7723 child_process.exec command, (error, stdout, stderr) -> - return onUpdate(null, stdout, stderr) if error? + return onUpdate(null, stdout, stderr) if not error? if _.any [