Blame SOURCES/0002-Suppress-NPM-message-to-run-global-update.patch

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