From cc338d40390e304bda63750cbcd94d42a8c1e9ef Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sat, 4 Feb 2017 11:24:21 +0100 Subject: [PATCH] Only show update notification if one is available --- bin/now.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/now.js b/bin/now.js index 7c011d9..48b818f 100755 --- a/bin/now.js +++ b/bin/now.js @@ -31,11 +31,13 @@ if (!process.pkg && pkg.dist) { const notifier = updateNotifier({pkg}) const update = notifier.update - let message = `Update available! ${chalk.red(update.current)} → ${chalk.green(update.latest)} \n` - message += `Run ${chalk.magenta('npm i -g now')} to update!\n` - message += `${chalk.magenta('Changelog:')} https://github.com/zeit/now-cli/releases/tag/${update.latest}` + if (update) { + let message = `Update available! ${chalk.red(update.current)} → ${chalk.green(update.latest)} \n` + message += `Run ${chalk.magenta('npm i -g now')} to update!\n` + message += `${chalk.magenta('Changelog:')} https://github.com/zeit/now-cli/releases/tag/${update.latest}` - notifier.notify({message}) + notifier.notify({message}) + } } // This command will be run if no other sub command is specified