diff options
-rwxr-xr-x | cli.js | 5 | ||||
-rw-r--r-- | lib/utils/ini.js | 4 | ||||
-rwxr-xr-x | npm.js | 8 |
3 files changed, 4 insertions, 13 deletions
@@ -9,8 +9,9 @@ log("ok", "it worked if it ends with") var fs = require("fs") , path = require("path") , sys = require("sys") - , npm = require("./npm") - , ini = require("./lib/utils/ini") + // kludge for earlier nodes' lack of absolute module identity + , npm = require(__dirname+"/npm") + , ini = require(__dirname+"/lib/utils/ini") // supported commands. , argv = process.argv.slice(2) diff --git a/lib/utils/ini.js b/lib/utils/ini.js index f1d016213..18f5b377d 100644 --- a/lib/utils/ini.js +++ b/lib/utils/ini.js @@ -22,7 +22,6 @@ exports.save = save exports.del = del exports.get = get exports.set = set -exports.RESOLVED = false Object.defineProperty(exports, "keys", { get : function () { return configList.keys }}) @@ -52,8 +51,6 @@ var fs = require("fs") configList.push(defaultConfig) function resolveConfigs (cli, cb) { - if (!cb) cb = cli, cli = {} - if (exports.RESOLVED) return cb() var cl = configList , dc = cl.pop() if (!cb) cb = cli, cli = {} @@ -67,7 +64,6 @@ function resolveConfigs (cli, cb) { if (er) return cb(er) cl.push(conf) cl.push(dc) - exports.RESOLVED = true // make sure that the root folder exists // This is a bit of a kludge, but until we can abstract out // file read/write in a clean way, this is the only single @@ -55,13 +55,7 @@ var commandCache = {} : c === "rm" ? "uninstall" : c if (c in commandCache) return commandCache[c] - return commandCache[c] = function (args, cb) { - var f = require(__dirname+"/lib/"+c) - ini.resolveConfigs(function (er) { - if (er) return cb(er) - f(args, cb) - }) - } + return commandCache[c] = require(__dirname+"/lib/"+c) }}) }) |