From e1eec1b311423d477dc5a160e75e7fb2c11f0ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 3 Sep 2018 15:24:49 +0200 Subject: [PATCH] cli: literally don't run update-notifier in CI environment This is a followup to #33 that changes the logic to literally *not* run update-notifier in CI environment, instead of running it and omitting the result. --- bin/npm-cli.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/npm-cli.js b/bin/npm-cli.js index 6f76b23828531..5168c78169475 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -78,16 +78,15 @@ if (er) return errorHandler(er) if ( !isGlobalNpmUpdate && + !require('ci-info').isCI && npm.config.get('update-notifier') && !unsupported.checkVersion(process.version).unsupported ) { const pkg = require('../package.json') let notifier = require('update-notifier')({pkg}) - const isCI = require('ci-info').isCI if ( notifier.update && - notifier.update.latest !== pkg.version && - !isCI + notifier.update.latest !== pkg.version ) { const color = require('ansicolors') const useColor = npm.config.get('color')