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:
-rw-r--r--node_modules/npmconf/lib/load-prefix.js61
-rw-r--r--node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json3
-rw-r--r--node_modules/npmconf/npmconf.js21
-rw-r--r--node_modules/npmconf/package.json28
-rw-r--r--package.json2
5 files changed, 49 insertions, 66 deletions
diff --git a/node_modules/npmconf/lib/load-prefix.js b/node_modules/npmconf/lib/load-prefix.js
index c161b0649..8d97fcf84 100644
--- a/node_modules/npmconf/lib/load-prefix.js
+++ b/node_modules/npmconf/lib/load-prefix.js
@@ -7,45 +7,36 @@ var path = require('path')
function loadPrefix (cb) {
var cli = this.list[0]
- // try to guess at a good node_modules location.
- var p
- , gp
-
- if (!Object.prototype.hasOwnProperty.call(cli, "prefix")) {
- p = process.cwd()
- } else {
- p = this.get("prefix")
- }
- gp = this.get("prefix")
-
- findPrefix(p, function (er, p) {
- Object.defineProperty(this, "localPrefix",
- { get : function () { return p }
- , set : function (r) { return p = r }
- , enumerable : true
- })
- // the prefix MUST exist, or else nothing works.
- if (!this.get("global")) {
- mkdirp(p, next.bind(this))
- } else {
- next.bind(this)(er)
- }
- }.bind(this))
+ Object.defineProperty(this, "prefix",
+ { get : function () {
+ var g = this.get("global")
+ return g ? this.globalPrefix : this.localPrefix
+ }.bind(this)
+ , enmerable : true
+ })
- gp = path.resolve(gp)
Object.defineProperty(this, "globalPrefix",
- { get : function () { return gp }
- , set : function (r) { return gp = r }
+ { get : function () {
+ return path.resolve(this.get("prefix"))
+ }.bind(this)
, enumerable : true
})
- // the prefix MUST exist, or else nothing works.
- mkdirp(gp, next.bind(this))
- var i = 2
- var errState = null
- function next (er) {
- if (errState) return
- if (er) return cb(errState = er)
- if (--i === 0) return cb()
+ var p
+ Object.defineProperty(this, "localPrefix",
+ { get : function () { return p }
+ , enumerable: true })
+
+ // try to guess at a good node_modules location.
+ // If we are *explicitly* given a prefix on the cli, then
+ // always use that. otherwise, infer local prefix from cwd.
+ if (Object.prototype.hasOwnProperty.call(cli, "prefix")) {
+ p = path.resolve(cli.prefix)
+ process.nextTick(cb)
+ } else {
+ findPrefix(process.cwd(), function (er, found) {
+ p = found
+ cb(er)
+ }.bind(this))
}
}
diff --git a/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
index 8bea252b7..2dff2917c 100644
--- a/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
+++ b/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
@@ -46,5 +46,6 @@
"tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz"
+ "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/node_modules/npmconf/npmconf.js b/node_modules/npmconf/npmconf.js
index aa2c7b2e6..c319c64d4 100644
--- a/node_modules/npmconf/npmconf.js
+++ b/node_modules/npmconf/npmconf.js
@@ -103,7 +103,7 @@ function load_(builtin, rc, cli, cb) {
conf.add(cli, 'cli')
conf.addEnv()
- conf.loadExtras(function(er) {
+ conf.loadPrefix(function(er) {
if (er)
return cb(er)
@@ -139,10 +139,14 @@ function load_(builtin, rc, cli, cb) {
conf.root = defaults
conf.add(rc.shift(), 'builtin')
conf.once('load', function () {
- // warn about invalid bits.
- validate(conf)
- exports.loaded = conf
- cb(null, conf)
+ conf.loadExtras(function(er) {
+ if (er)
+ return cb(er)
+ // warn about invalid bits.
+ validate(conf)
+ exports.loaded = conf
+ cb(er, conf)
+ })
})
}
}
@@ -174,13 +178,14 @@ Conf.prototype.setUser = require('./lib/set-user.js')
Conf.prototype.findPrefix = require('./lib/find-prefix.js')
Conf.prototype.loadExtras = function(cb) {
- this.loadPrefix(function(er) {
+ this.setUser(function(er) {
if (er)
return cb(er)
- this.setUser(function(er) {
+ this.loadUid(function(er) {
if (er)
return cb(er)
- this.loadUid(cb)
+ // Without prefix, nothing will ever work
+ mkdirp(this.prefix, cb)
}.bind(this))
}.bind(this))
}
diff --git a/node_modules/npmconf/package.json b/node_modules/npmconf/package.json
index 2c20e1e6c..3d78e12d9 100644
--- a/node_modules/npmconf/package.json
+++ b/node_modules/npmconf/package.json
@@ -1,6 +1,6 @@
{
"name": "npmconf",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "The config thing npm uses",
"main": "npmconf.js",
"directories": {
@@ -40,28 +40,14 @@
"url": "http://blog.izs.me"
},
"license": "BSD",
- "gitHead": "15b5b8a70d722526f94d2b0c6b835d40b0a2965f",
+ "readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n",
+ "readmeFilename": "README.md",
+ "gitHead": "4dff9a9a141830eabc289f2af791274a3aa9351b",
"bugs": {
"url": "https://github.com/isaacs/npmconf/issues"
},
"homepage": "https://github.com/isaacs/npmconf",
- "_id": "npmconf@1.0.3",
- "_shasum": "d34cbdfd680c9c57c66ef26239b2f96a51d0e47d",
- "_from": "npmconf@latest",
- "_npmVersion": "1.4.14",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "dist": {
- "shasum": "d34cbdfd680c9c57c66ef26239b2f96a51d0e47d",
- "tarball": "http://registry.npmjs.org/npmconf/-/npmconf-1.0.3.tgz"
- },
- "_resolved": "https://registry.npmjs.org/npmconf/-/npmconf-1.0.3.tgz"
+ "_id": "npmconf@1.0.4",
+ "_shasum": "63352f866a910f6274346d0a5785d65dce594487",
+ "_from": "npmconf@latest"
}
diff --git a/package.json b/package.json
index 99fb49ad4..fa49cb954 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"npm-install-checks": "~1.0.2",
"npm-registry-client": "1",
"npm-user-validate": "~0.1.0",
- "npmconf": "~1.0.2",
+ "npmconf": "~1.0.4",
"npmlog": "~0.1.0",
"once": "~1.3.0",
"opener": "~1.3.0",