From 0830aabe084e3f209dfd7542ba40a73e2b0daba4 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Thu, 15 Dec 2016 08:15:13 +0100 Subject: [PATCH] Only show update message in npm version This closes #62 --- bin/now.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/now.js b/bin/now.js index edbdcd2..cbcd118 100755 --- a/bin/now.js +++ b/bin/now.js @@ -22,11 +22,19 @@ const argv = minimist(process.argv.slice(2)) // options const debug = argv.debug || argv.d +// Disable updates by default +let update = false + // auto-update checking -const update = checkUpdate({debug}) +// only for the npm version, not the enclosed one +if (!process.pkg) { + update = checkUpdate({debug}) +} const exit = code => { - update.then(() => process.exit(code)) + if (update) { + update.then(() => process.exit(code)) + } // don't wait for updates more than a second // when the process really wants to exit setTimeout(() => process.exit(code), 1000)