Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cli.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-08-02 08:35:26 +0400
committerisaacs <i@izs.me>2010-08-03 04:31:26 +0400
commit42c6c6fbada0725eafb7ce0a16d91920c50bd4ca (patch)
tree5bcdf890ecc870339b6cee8ad43b405446158356 /cli.js
parent1e0f5c494261ce55d74bb557da98abe97ff2af2e (diff)
Resolve configs, passing in the cli flags
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli.js b/cli.js
index 1fe5fd71a..fb78b996b 100755
--- a/cli.js
+++ b/cli.js
@@ -10,6 +10,7 @@ var fs = require("fs")
, path = require("path")
, sys = require("sys")
, npm = require("./npm")
+ , ini = require("./lib/utils/ini")
// supported commands.
, argv = process.argv.slice(2)
@@ -41,7 +42,6 @@ while (arg = argv.shift()) {
}
if (key) conf[key] = true
npm.argv = arglist
-for (var k in conf) npm.config.set(k, conf[k])
var vindex = arglist.indexOf("-v")
, printVersion = vindex !== -1 || conf.version
@@ -67,7 +67,13 @@ if (!command) {
)
process.exit(1)
} else itWorked = true
-} else npm.commands[command](arglist, errorHandler)
+} else {
+ ini.resolveConfigs(conf, function (er) {
+ if (er) return errorHandler(er)
+ npm.config.set("root", ini.get("root"))
+ npm.commands[command](arglist, errorHandler)
+ })
+}
function errorHandler (er) {
if (!er) {