mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Log warning if bundle not found
This commit is contained in:
parent
98b873d48d
commit
50ff40f6f3
@ -86,6 +86,8 @@
|
||||
}
|
||||
|
||||
nodeDownload = function(destination, options, callback) {
|
||||
var error;
|
||||
try {
|
||||
return binary.download(options, destination, function(error, binaryPath) {
|
||||
var output;
|
||||
if (error != null) {
|
||||
@ -99,6 +101,10 @@
|
||||
return callback(null, output);
|
||||
});
|
||||
});
|
||||
} catch (_error) {
|
||||
error = _error;
|
||||
return callback(error);
|
||||
}
|
||||
};
|
||||
|
||||
async.eachLimit(bundles, 2, function(bundle, callback) {
|
||||
@ -108,14 +114,15 @@
|
||||
return callback(error);
|
||||
}
|
||||
console.info("Downloaded: " + (getNodeName(bundle)) + " to " + output);
|
||||
return callback(null, output);
|
||||
return callback();
|
||||
});
|
||||
}, function(error) {
|
||||
if (error != null) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
console.error(error.message);
|
||||
return console.error('Error: Couldn\'t get the required node bundle. Omitting.');
|
||||
} else {
|
||||
return console.info('All NodeJS bundles downloaded');
|
||||
}
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
@ -56,21 +56,25 @@ for bundle in bundles
|
||||
console.info "- #{getNodeName(bundle)}"
|
||||
|
||||
nodeDownload = (destination, options, callback) ->
|
||||
try
|
||||
binary.download options, destination, (error, binaryPath) ->
|
||||
return callback(error) if error?
|
||||
output = path.join(destination, getNodeName(options))
|
||||
fs.rename binaryPath, output, (error) ->
|
||||
return callback(error) if error?
|
||||
return callback(null, output)
|
||||
catch error
|
||||
return callback(error)
|
||||
|
||||
async.eachLimit bundles, 2, (bundle, callback) ->
|
||||
console.info("Downloading: #{getNodeName(bundle)} to #{DESTINATION}")
|
||||
return nodeDownload DESTINATION, bundle, (error, output) ->
|
||||
return callback(error) if error?
|
||||
console.info("Downloaded: #{getNodeName(bundle)} to #{output}")
|
||||
return callback(null, output)
|
||||
return callback()
|
||||
, (error) ->
|
||||
if error?
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
console.error(error.message)
|
||||
console.error('Error: Couldn\'t get the required node bundle. Omitting.')
|
||||
else
|
||||
console.info('All NodeJS bundles downloaded')
|
||||
|
Loading…
Reference in New Issue
Block a user