2018-08-16 11:15:31 +00:00
|
|
|
From 5fa6ec054f98e7e2e480feab792d51ff4100f1d9 Mon Sep 17 00:00:00 2001
|
2018-05-30 14:26:09 +00:00
|
|
|
From: Stephen Gallagher <sgallagh@redhat.com>
|
|
|
|
Date: Tue, 1 May 2018 08:05:30 -0400
|
2018-06-07 12:54:08 +00:00
|
|
|
Subject: [PATCH 2/2] Suppress NPM message to run global update
|
2018-05-30 14:26:09 +00:00
|
|
|
|
|
|
|
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
|
|
|
---
|
2018-08-07 14:49:16 +00:00
|
|
|
deps/npm/bin/npm-cli.js | 49 -----------------------------------------
|
|
|
|
1 file changed, 49 deletions(-)
|
2018-05-30 14:26:09 +00:00
|
|
|
|
|
|
|
diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js
|
2018-08-07 14:49:16 +00:00
|
|
|
index a38009d276e3bb7cb26e9536b62596c336ff8fb5..98edb6f45fe073e03794a2ae6e7aa7f5500723ee 100755
|
2018-05-30 14:26:09 +00:00
|
|
|
--- a/deps/npm/bin/npm-cli.js
|
|
|
|
+++ b/deps/npm/bin/npm-cli.js
|
2018-08-07 14:49:16 +00:00
|
|
|
@@ -72,59 +72,10 @@
|
2018-05-30 14:26:09 +00:00
|
|
|
// 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)
|
2018-08-07 14:49:16 +00:00
|
|
|
- if (
|
|
|
|
- npm.config.get('update-notifier') &&
|
|
|
|
- !unsupported.checkVersion(process.version).unsupported
|
|
|
|
- ) {
|
2018-05-30 14:26:09 +00:00
|
|
|
- const pkg = require('../package.json')
|
|
|
|
- let notifier = require('update-notifier')({pkg})
|
|
|
|
- if (
|
|
|
|
- notifier.update &&
|
|
|
|
- notifier.update.latest !== pkg.version
|
|
|
|
- ) {
|
|
|
|
- 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
|
|
|
|
- }
|
|
|
|
- }
|
2018-08-07 14:49:16 +00:00
|
|
|
- const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
|
2018-05-30 14:26:09 +00:00
|
|
|
- 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 (
|
|
|
|
!err &&
|
|
|
|
npm.config.get('ham-it-up') &&
|
|
|
|
--
|
2018-08-16 11:15:31 +00:00
|
|
|
2.18.0
|
2018-05-30 14:26:09 +00:00
|
|
|
|