Use "error?" to check error.

This commit is contained in:
Cheng Zhao
2014-02-13 21:42:10 +08:00
parent def39f94df
commit a78dff15c4

View File

@@ -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."