Skip to content

Commit

Permalink
config: don't ham-it-up when expecting parseable output (#16336)
Browse files Browse the repository at this point in the history
* Don't ham-it-up when expecting JSON

I turned on the ham-it-up configuration setting, and then noticed that I received an error when running the npm-windows-upgrade module, because it was trying to parse the JSON from calling `npm view npm versions --json` and didn't know what to do with the easter egg text at the end.

This change disables the ham-it-up text when the json option is present.

PR-URL: npm/npm#16336
Credit: @bdukes
Reviewed-By: @zkat
  • Loading branch information
bdukes authored and zkat committed Apr 17, 2017
1 parent f5e8bec commit 2afa924
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/npm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
if (er) return errorHandler(er)
npm.commands[npm.command](npm.argv, function (err) {
// https://www.youtube.com/watch?v=7nfPu8qTiQU
if (!err && npm.config.get('ham-it-up')) {
if (!err && npm.config.get('ham-it-up') && !npm.config.get('json') && !npm.config.get('parseable')) {
output('\n 🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋\n')
}
errorHandler.apply(this, arguments)
Expand Down

0 comments on commit 2afa924

Please sign in to comment.