mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 17:33:18 +00:00
Make cleanup reliable if a local build fails
This commit is contained in:
parent
66a4faeea5
commit
5a28d4c92f
@ -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) {
|
||||
|
@ -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)}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user