diff options
author | isaacs <i@izs.me> | 2010-08-05 20:26:12 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-08-05 20:26:12 +0400 |
commit | 1b6515b80a07e96ee9eca695ce9de71ba2c15b2a (patch) | |
tree | a6146593a848ab35429bc5572738a6857a509c51 | |
parent | dedd346a2be91e78437e0bf0b0cf25b3ad7df3b7 (diff) |
Fix for earlier versions of node that didn't have proper module identity.
Rollback previous non-fix for 155 and 154. This actually fixes #155 and #154
-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) }}) }) |