mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 06:07:55 +00:00
f19588032f
For this we use the `update-notifier` module with its default settings. This module will print a nice banner prompting the user to run the corresponding npm command to update.
24 lines
437 B
JavaScript
24 lines
437 B
JavaScript
(function() {
|
|
var notifier, packageJSON, updateNotifier;
|
|
|
|
updateNotifier = require('update-notifier');
|
|
|
|
packageJSON = require('../../package.json');
|
|
|
|
notifier = updateNotifier({
|
|
pkg: packageJSON
|
|
});
|
|
|
|
exports.hasAvailableUpdate = function() {
|
|
return notifier != null;
|
|
};
|
|
|
|
exports.notify = function() {
|
|
if (!exports.hasAvailableUpdate()) {
|
|
return;
|
|
}
|
|
return notifier.notify();
|
|
};
|
|
|
|
}).call(this);
|