da4c46
From ab6c18fd9aba942bee3f2f8030273c846b6025a6 Mon Sep 17 00:00:00 2001
da4c46
From: Stephen Gallagher <sgallagh@redhat.com>
da4c46
Date: Tue, 1 May 2018 08:05:30 -0400
da4c46
Subject: [PATCH 2/2] Suppress NPM message to run global update
da4c46
da4c46
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
da4c46
---
da4c46
 deps/npm/bin/npm-cli.js | 54 -----------------------------------------
da4c46
 1 file changed, 54 deletions(-)
da4c46
da4c46
diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js
da4c46
index 6f76b23828531e7af98a7e3cd7d5abfaac09b40c..98edb6f45fe073e03794a2ae6e7aa7f5500723ee 100755
da4c46
--- a/deps/npm/bin/npm-cli.js
da4c46
+++ b/deps/npm/bin/npm-cli.js
da4c46
@@ -67,69 +67,15 @@
da4c46
   if (conf.usage && npm.command !== 'help') {
da4c46
     npm.argv.unshift(npm.command)
da4c46
     npm.command = 'help'
da4c46
   }
da4c46
 
da4c46
-  var isGlobalNpmUpdate = conf.global && ['install', 'update'].includes(npm.command) && npm.argv.includes('npm')
da4c46
-
da4c46
   // now actually fire up npm and run the command.
da4c46
   // this is how to use npm programmatically:
da4c46
   conf._exit = true
da4c46
   npm.load(conf, function (er) {
da4c46
     if (er) return errorHandler(er)
da4c46
-    if (
da4c46
-      !isGlobalNpmUpdate &&
da4c46
-      npm.config.get('update-notifier') &&
da4c46
-      !unsupported.checkVersion(process.version).unsupported
da4c46
-    ) {
da4c46
-      const pkg = require('../package.json')
da4c46
-      let notifier = require('update-notifier')({pkg})
da4c46
-      const isCI = require('ci-info').isCI
da4c46
-      if (
da4c46
-        notifier.update &&
da4c46
-        notifier.update.latest !== pkg.version &&
da4c46
-        !isCI
da4c46
-      ) {
da4c46
-        const color = require('ansicolors')
da4c46
-        const useColor = npm.config.get('color')
da4c46
-        const useUnicode = npm.config.get('unicode')
da4c46
-        const old = notifier.update.current
da4c46
-        const latest = notifier.update.latest
da4c46
-        let type = notifier.update.type
da4c46
-        if (useColor) {
da4c46
-          switch (type) {
da4c46
-            case 'major':
da4c46
-              type = color.red(type)
da4c46
-              break
da4c46
-            case 'minor':
da4c46
-              type = color.yellow(type)
da4c46
-              break
da4c46
-            case 'patch':
da4c46
-              type = color.green(type)
da4c46
-              break
da4c46
-          }
da4c46
-        }
da4c46
-        const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
da4c46
-        notifier.notify({
da4c46
-          message: `New ${type} version of ${pkg.name} available! ${
da4c46
-            useColor ? color.red(old) : old
da4c46
-          } ${useUnicode ? '→' : '->'} ${
da4c46
-            useColor ? color.green(latest) : latest
da4c46
-          }\n` +
da4c46
-          `${
da4c46
-            useColor ? color.yellow('Changelog:') : 'Changelog:'
da4c46
-          } ${
da4c46
-            useColor ? color.cyan(changelog) : changelog
da4c46
-          }\n` +
da4c46
-          `Run ${
da4c46
-            useColor
da4c46
-              ? color.green(`npm install -g ${pkg.name}`)
da4c46
-              : `npm i -g ${pkg.name}`
da4c46
-          } to update!`
da4c46
-        })
da4c46
-      }
da4c46
-    }
da4c46
     npm.commands[npm.command](npm.argv, function (err) {
da4c46
       // https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
da4c46
       if (
da4c46
         !err &&
da4c46
         npm.config.get('ham-it-up') &&
da4c46
-- 
da4c46
2.19.0
da4c46