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

Commit

Permalink
cli: fix easter egg (#20214)
Browse files Browse the repository at this point in the history
PR-URL: #20214
Credit: @zkat
  • Loading branch information
zkat authored and iarna committed May 4, 2018
1 parent bd29baf commit 5dc27c8
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions bin/npm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
var npm = require('../lib/npm.js')
var npmconf = require('../lib/config/core.js')
var errorHandler = require('../lib/utils/error-handler.js')
var output = require('../lib/utils/output.js')

var configDefs = npmconf.defs
var shorthands = configDefs.shorthands
Expand Down Expand Up @@ -120,9 +119,23 @@
}
}
npm.commands[npm.command](npm.argv, function (err) {
// https://www.youtube.com/watch?v=7nfPu8qTiQU
if (!err && npm.config.get('ham-it-up') && !npm.config.get('json') && !npm.config.get('parseable') && npm.command !== 'completion') {
output('\n 🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋\n')
// https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
if (
!err &&
npm.config.get('ham-it-up') &&
!npm.config.get('json') &&
!npm.config.get('parseable') &&
npm.command !== 'completion'
) {
console.error(
`\n ${
npm.config.get('unicode') ? '🎵 ' : ''
} I Have the Honour to Be Your Obedient Servant,${
npm.config.get('unicode') ? '🎵 ' : ''
} ~ npm ${
npm.config.get('unicode') ? '📜🖋 ' : ''
}\n`
)
}
errorHandler.apply(this, arguments)
})
Expand Down

0 comments on commit 5dc27c8

Please sign in to comment.