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