diff options
author | isaacs <i@izs.me> | 2012-08-22 21:49:48 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-08-22 21:49:48 +0400 |
commit | 01f9be082019628025f789d811f77f51c5e5cc30 (patch) | |
tree | 85fe5c22af9a1b599602db706430f6a609f60c03 | |
parent | fe1b16c1fdb9cc0fc596d3b7b14f35953870e0ca (diff) |
npmconf@0.0.11
Fix issue with saving builtin conf
-rw-r--r-- | node_modules/npmconf/npmconf.js | 12 | ||||
-rw-r--r-- | node_modules/npmconf/package.json | 9 |
2 files changed, 13 insertions, 8 deletions
diff --git a/node_modules/npmconf/npmconf.js b/node_modules/npmconf/npmconf.js index 41ba25142..e32a95819 100644 --- a/node_modules/npmconf/npmconf.js +++ b/node_modules/npmconf/npmconf.js @@ -144,14 +144,22 @@ function Conf (base) { Conf.prototype.save = function (where, cb) { var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) - return this.emit('error', new Error('bad save target: '+where)) + if (!target || !(target.path || target.source) || !target.data) { + if (where !== 'builtin') + var er = new Error('bad save target: '+where) + if (cb) { + process.nextTick(cb.bind(null, er)) + return this + } + return this.emit('error', er) + } if (target.source) { var pref = target.prefix || '' Object.keys(target.data).forEach(function (k) { target.source[pref + k] = target.data[k] }) + if (cb) process.nextTick(cb) return this } diff --git a/node_modules/npmconf/package.json b/node_modules/npmconf/package.json index a8fdb942d..849e8f229 100644 --- a/node_modules/npmconf/package.json +++ b/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "0.0.10", + "version": "0.0.11", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -39,9 +39,6 @@ "nopt": "~2.0.0" }, "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", - "_id": "npmconf@0.0.10", - "dist": { - "shasum": "ca44e3fb565938753f7113f21baec96a27f2095d" - }, - "_from": "npmconf@0.0.10" + "_id": "npmconf@0.0.11", + "_from": "npmconf@0" } |