diff options
author | isaacs <i@izs.me> | 2012-04-18 11:25:26 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-04-18 11:31:55 +0400 |
commit | e5d78176e65edfce6c2979c9c9adbeeb783be09a (patch) | |
tree | 5bab256b4e3c4efbcd3c787154e097cbb12bc6f1 | |
parent | de80b21ce08f56704c99eae4fd9da7314fa058b8 (diff) |
Regression in dev/optional --save stuff
-rw-r--r-- | lib/install.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/install.js b/lib/install.js index 36754f2c2..5873ca968 100644 --- a/lib/install.js +++ b/lib/install.js @@ -260,14 +260,18 @@ function save (where, installed, tree, pretty, cb) { } catch (ex) { er = ex } - if (er) return cb(null, installed, tree, pretty) + if (er) { + return cb(null, installed, tree, pretty) + + } var deps = npm.config.get("save-optional") ? "optionalDependencies" : npm.config.get("save-dev") ? "devDependencies" : "dependencies" + data[deps] = data[deps] || {} Object.keys(things).forEach(function (t) { - deps[t] = things[t] + data[deps][t] = things[t] }) data = JSON.stringify(data, null, 2) + "\n" fs.writeFile(saveTarget, data, function (er) { |