balena-cli/build/utils/update.js
Juan Cruz Viotti f19588032f Notify the user if there is an available update
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.
2015-08-18 08:53:06 -04:00

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);