diff options
author | Rebecca Turner <me@re-becca.org> | 2015-04-20 11:34:44 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-06-26 03:26:52 +0300 |
commit | 24a149faed33dc1faeff78877fb9f95bc5c6a9e3 (patch) | |
tree | c9595155c2e427dedb6c507770734cd53d76d63b | |
parent | f9b6abf0262126ff35a81b3ad8ca71e63d1935b5 (diff) |
Stop stray progressbars from appearing when logging is used in non-progress commands
-rwxr-xr-x | bin/npm-cli.js | 2 | ||||
-rw-r--r-- | lib/npm.js | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/bin/npm-cli.js b/bin/npm-cli.js index b01e8477e..82a75be52 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -22,6 +22,7 @@ log.enableProgress() log.info("it worked if it ends with", "ok") var path = require("path") + , log = require("npmlog") , npm = require("../lib/npm.js") , npmconf = require("../lib/config/core.js") , errorHandler = require("../lib/utils/error-handler.js") @@ -71,6 +72,7 @@ if (conf.usage && npm.command !== "help") { conf._exit = true npm.load(conf, function (er) { if (er) return errorHandler(er) + log.enableProgress() npm.commands[npm.command](npm.argv, errorHandler) }) diff --git a/lib/npm.js b/lib/npm.js index d530ea8d7..67cc79876 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -157,8 +157,6 @@ fullList = npm.fullList = fullList.filter(function (c) { return littleGuys.indexOf(c) === -1 }) -showProgress = log.progressEnabled - Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { Object.defineProperty(npm.commands, c, { get : function () { if (!loaded) throw new Error( @@ -178,7 +176,6 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { var args = Array.prototype.slice.call(arguments, 0) if (typeof args[args.length - 1] !== "function") { args.push(defaultCb) - log.enableProgress() } if (args.length === 1) args.unshift([]) |