Fix logical issue in update command

This commit is contained in:
Juan Cruz Viotti 2015-04-20 12:42:31 -04:00
parent ae8c941bfe
commit 37d96e238d
2 changed files with 2 additions and 2 deletions

View File

@ -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'])) {

View File

@ -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 [