From 1cfbd4197d4a7079221e7f21a5b8abbf826adfea Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 15 Oct 2015 09:18:45 -0400 Subject: [PATCH] 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. --- build/utils/update.js | 8 ++++++-- lib/utils/update.coffee | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/utils/update.js b/build/utils/update.js index f5df4263..a3b4f2ec 100644 --- a/build/utils/update.js +++ b/build/utils/update.js @@ -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); diff --git a/lib/utils/update.coffee b/lib/utils/update.coffee index 340bd975..9076f548 100644 --- a/lib/utils/update.coffee +++ b/lib/utils/update.coffee @@ -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')