diff --git a/build/actions/deploy.js b/build/actions/deploy.js index f8c76489..5dd808fa 100644 --- a/build/actions/deploy.js +++ b/build/actions/deploy.js @@ -229,7 +229,9 @@ module.exports = { logs = buildLogs; return Promise.all([dockerUtils.bufferImage(docker, imageName, bufferFile), token, username, url, params.appName, logStreams]).spread(performUpload); })["finally"](function() { - return require('mz/fs').unlink(bufferFile)["catch"](_.noop); + return Promise["try"](function() { + return require('mz/fs').unlink(bufferFile); + })["catch"](_.noop); }); }); }).tap(function(arg) { diff --git a/lib/actions/deploy.coffee b/lib/actions/deploy.coffee index 8c81ae7f..a90991b8 100644 --- a/lib/actions/deploy.coffee +++ b/lib/actions/deploy.coffee @@ -206,7 +206,8 @@ module.exports = # If the file was never written to (for instance because an error # has occured before any data was written) this call will throw an # ugly error, just suppress it - require('mz/fs').unlink(bufferFile) + Promise.try -> + require('mz/fs').unlink(bufferFile) .catch(_.noop) .tap ({ image: imageName, buildId }) -> logging.logSuccess(logStreams, "Successfully deployed image: #{formatImageName(imageName)}")