mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Improve the way the update notifier is shown
Current has the following problems: - Our custom message gets printed even if the notifier doesn't contain an update. - The notifier box is deferred, therefore it's printed at the end of the command. Since our custom message is printed at the beginning, it makes no sense at all.
This commit is contained in:
parent
0ba914236a
commit
1cfbd4197d
@ -21,8 +21,12 @@
|
||||
if (!exports.hasAvailableUpdate()) {
|
||||
return;
|
||||
}
|
||||
notifier.notify();
|
||||
return console.log('Notice that you might need administrator privileges depending on your setup');
|
||||
notifier.notify({
|
||||
defer: false
|
||||
});
|
||||
if (notifier.update != null) {
|
||||
return console.log('Notice that you might need administrator privileges depending on your setup\n');
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
@ -13,5 +13,6 @@ exports.hasAvailableUpdate = ->
|
||||
|
||||
exports.notify = ->
|
||||
return if not exports.hasAvailableUpdate()
|
||||
notifier.notify()
|
||||
console.log('Notice that you might need administrator privileges depending on your setup')
|
||||
notifier.notify(defer: false)
|
||||
if notifier.update?
|
||||
console.log('Notice that you might need administrator privileges depending on your setup\n')
|
||||
|
Loading…
Reference in New Issue
Block a user