eea246
From e7afb2d6e2a6c8f9c9c32e12a10c3c5c4902a251 Mon Sep 17 00:00:00 2001
c3d593
From: Stephen Gallagher <sgallagh@redhat.com>
c3d593
Date: Tue, 1 May 2018 08:05:30 -0400
eea246
Subject: [PATCH] Suppress NPM message to run global update
c3d593
c3d593
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
eea246
Signed-off-by: rpm-build <rpm-build>
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
eea246
index c0d9be0..0f0892e 100755
c3d593
--- a/deps/npm/bin/npm-cli.js
c3d593
+++ b/deps/npm/bin/npm-cli.js
eea246
@@ -71,65 +71,11 @@
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
-- 
eea246
2.26.2
c3d593