mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-30 10:38:50 +00:00
24 lines
903 B
JavaScript
24 lines
903 B
JavaScript
(function() {
|
|
var packageJSON, selfupdate;
|
|
|
|
selfupdate = require('selfupdate');
|
|
|
|
packageJSON = require('../../package.json');
|
|
|
|
exports.update = {
|
|
signature: 'update',
|
|
description: 'update the resin cli',
|
|
help: 'Use this command to update the Resin CLI\n\nThis command outputs information about the update process.\nUse `--quiet` to remove that output.\n\nThe Resin CLI checks for updates once per day.\n\nMajor updates require a manual update with this update command,\nwhile minor updates are applied automatically.\n\nExamples:\n\n $ resin update',
|
|
action: function(params, options, done) {
|
|
return selfupdate.update(packageJSON, function(error, version) {
|
|
if (error != null) {
|
|
return done(error);
|
|
}
|
|
console.info("Updated " + packageJSON.name + " to version " + version + ".");
|
|
return done();
|
|
});
|
|
}
|
|
};
|
|
|
|
}).call(this);
|