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
diff options
context:
space:
mode:
-rwxr-xr-xcli.js5
-rw-r--r--lib/utils/ini.js4
-rwxr-xr-xnpm.js8
3 files changed, 4 insertions, 13 deletions
diff --git a/cli.js b/cli.js
index 0e64d1aa1..41122118c 100755
--- a/cli.js
+++ b/cli.js
@@ -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
diff --git a/npm.js b/npm.js
index a83fd349e..a92d798ff 100755
--- a/npm.js
+++ b/npm.js
@@ -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)
}})
})