Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Olore <brian@olore.net>2018-08-03 19:21:58 +0300
committerKat Marchán <kzm@zkat.tech>2018-08-03 19:21:58 +0300
commitd8114618137bb5b9a52a86711bb8dc18bfc8e60c (patch)
tree621ce49bdcf7de88a305d9b4c19d2fbdd0e1eb44 /bin/npm-cli.js
parent792c8c709dc7a445687aa0c8cba5c50bc4ed83fd (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/npm-cli.js')
-rwxr-xr-xbin/npm-cli.js3
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
) {