From a78dff15c464d46df0089e3aeb025ca507811f35 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 13 Feb 2014 21:42:10 +0800 Subject: [PATCH] Use "error?" to check error. --- src/command-installer.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command-installer.coffee b/src/command-installer.coffee index 63066cb30..a3b051e07 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -47,7 +47,7 @@ module.exports = error = null if error? - error = new Error "Could not remove file at #{destinationPath}." if error + error = new Error "Could not remove file at #{destinationPath}." callback?(error) else symlinkCommand commandPath, destinationPath, (error) => @@ -55,7 +55,7 @@ module.exports = if error?.code is 'EACCES' and symlinkCommandWithPrivilegeSync(commandPath, destinationPath) error = null - error = new Error "Failed to symlink #{commandPath} to #{destinationPath}." if error + error = new Error "Failed to symlink #{commandPath} to #{destinationPath}." if error? callback?(error) else error = new Error "Directory '#{directory} doesn't exist."