Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit ada9c6c

Browse files
committed
cli: fix easter egg (#20214)
PR-URL: #20214 Credit: @zkat
1 parent 77c3f7a commit ada9c6c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

bin/npm-cli.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
var npm = require('../lib/npm.js')
3636
var npmconf = require('../lib/config/core.js')
3737
var errorHandler = require('../lib/utils/error-handler.js')
38-
var output = require('../lib/utils/output.js')
3938

4039
var configDefs = npmconf.defs
4140
var shorthands = configDefs.shorthands
@@ -82,9 +81,23 @@
8281
npm.load(conf, function (er) {
8382
if (er) return errorHandler(er)
8483
npm.commands[npm.command](npm.argv, function (err) {
85-
// https://www.youtube.com/watch?v=7nfPu8qTiQU
86-
if (!err && npm.config.get('ham-it-up') && !npm.config.get('json') && !npm.config.get('parseable') && npm.command !== 'completion') {
87-
output('\n 🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋\n')
84+
// https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
85+
if (
86+
!err &&
87+
npm.config.get('ham-it-up') &&
88+
!npm.config.get('json') &&
89+
!npm.config.get('parseable') &&
90+
npm.command !== 'completion'
91+
) {
92+
console.error(
93+
`\n ${
94+
npm.config.get('unicode') ? '🎵 ' : ''
95+
} I Have the Honour to Be Your Obedient Servant,${
96+
npm.config.get('unicode') ? '🎵 ' : ''
97+
} ~ npm ${
98+
npm.config.get('unicode') ? '📜🖋 ' : ''
99+
}\n`
100+
)
88101
}
89102
errorHandler.apply(this, arguments)
90103
})

0 commit comments

Comments
 (0)