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