diff options
author | Brian Olore <brian@olore.net> | 2018-08-03 19:21:58 +0300 |
---|---|---|
committer | Kat Marchán <kzm@zkat.tech> | 2018-08-03 19:21:58 +0300 |
commit | d8114618137bb5b9a52a86711bb8dc18bfc8e60c (patch) | |
tree | 621ce49bdcf7de88a305d9b4c19d2fbdd0e1eb44 /bin | |
parent | 792c8c709dc7a445687aa0c8cba5c50bc4ed83fd (diff) |
cli: don't check for updates to npm when we are updating npm itself (#32)
PR-URL: https://github.com/npm/cli/pull/32
Credit: @olore
Reviewed-By: @zkat
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/npm-cli.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/npm-cli.js b/bin/npm-cli.js index a38009d27..e4da63c97 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -69,12 +69,15 @@ npm.command = 'help' } + var isGlobalNpmUpdate = conf.global && ['install', 'update'].includes(npm.command) && npm.argv.includes('npm') + // now actually fire up npm and run the command. // this is how to use npm programmatically: conf._exit = true npm.load(conf, function (er) { if (er) return errorHandler(er) if ( + !isGlobalNpmUpdate && npm.config.get('update-notifier') && !unsupported.checkVersion(process.version).unsupported ) { |