diff options
author | Brian Dukes <bdukes@engagesoftware.com> | 2017-04-18 01:18:29 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-04-18 01:18:29 +0300 |
commit | 2afa9240ce5b391671ed5416464f2882d18a94bc (patch) | |
tree | 2e32382b0087069dba7408640f907aace18944f4 | |
parent | f5e8becd05e0426379eb0c999abdbc8e87a7f6f2 (diff) |
config: don't ham-it-up when expecting parseable output (#16336)
* 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: https://github.com/npm/npm/pull/16336
Credit: @bdukes
Reviewed-By: @zkat
-rwxr-xr-x | bin/npm-cli.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/npm-cli.js b/bin/npm-cli.js index a83efdd54..c8c426f4a 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -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) |