diff options
author | isaacs <i@izs.me> | 2010-08-02 08:35:26 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-08-03 04:31:26 +0400 |
commit | 42c6c6fbada0725eafb7ce0a16d91920c50bd4ca (patch) | |
tree | 5bcdf890ecc870339b6cee8ad43b405446158356 | |
parent | 1e0f5c494261ce55d74bb557da98abe97ff2af2e (diff) |
Resolve configs, passing in the cli flags
-rwxr-xr-x | cli.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) { |