Browse Source

Only show update message in npm version

This closes #62
master
Leo Lamprecht 8 years ago
parent
commit
0830aabe08
No known key found for this signature in database GPG Key ID: B08517883D5E0E10
  1. 12
      bin/now.js

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

Loading…
Cancel
Save