Ignore errors unlinking non-existent path

This commit is contained in:
Kevin Sawicki
2013-06-05 11:54:21 -07:00
parent abbada47da
commit 69f7af7c63

View File

@@ -17,9 +17,9 @@ symlinkCommand = (sourcePath, destinationPath, callback) ->
fs.chmod(destinationPath, 0o755, callback)
unlinkCommand = (destinationPath, callback) ->
fs.exists destinationPath, (exists) ->
if exists
fs.unlink(destinationPath, callback)
fs.unlink destinationPath, (error) ->
if error? and error.code isnt 'ENOENT'
callback(error)
else
callback()