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