diff options
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/npm.js b/lib/npm.js index 34df1c233..c7288e2b7 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -336,20 +336,14 @@ function load (npm, cli, cb) { log.level = config.get("loglevel") log.heading = config.get("heading") || "npm" log.stream = config.get("logstream") - switch (color) { - case "always": log.enableColor(); break - case false: log.disableColor(); break - } - log.resume() - if (er) return cb(er) - - // see if we need to color normal output switch (color) { case "always": + log.enableColor() npm.color = true break case false: + log.disableColor() npm.color = false break default: @@ -361,6 +355,8 @@ function load (npm, cli, cb) { break } + log.resume() + // at this point the configs are all set. // go ahead and spin up the registry client. npm.registry = new RegClient(npm.config) @@ -376,7 +372,7 @@ function load (npm, cli, cb) { var lp = Object.getOwnPropertyDescriptor(config, "localPrefix") Object.defineProperty(npm, "localPrefix", lp) - return cb() + return cb(null, npm) }) }) } |