diff options
author | Rebecca Turner <me@re-becca.org> | 2015-08-15 11:35:36 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-08-21 22:30:44 +0300 |
commit | f130a0017aa6cb7bc2ca6042929085d55b26f253 (patch) | |
tree | 2be6bbccd9f5cec34b57b8a74a5b6730b364ec40 /lib | |
parent | 02420dc73ae185144267912e461da2effe90341d (diff) |
update: Fix path used to run the install relative to
Previously I was using the path of the module to be updated. But no, silly,
we want the path that CONTAINS it.
PR-URL: https://github.com/npm/npm/pull/9303
Fixes: #9095
Diffstat (limited to 'lib')
-rw-r--r-- | lib/update.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/update.js b/lib/update.js index 1d487a6e4..45f2817f5 100644 --- a/lib/update.js +++ b/lib/update.js @@ -43,15 +43,14 @@ function update (args, cb) { log.info('outdated', 'updating', wanted) var toInstall = {} wanted.forEach(function (ww) { - if (ww.current === ww.wanted) return - // use the initial installation method (repo, tar, git) for updating if (url.parse(ww.req).protocol) ww.what = ww.req - if (toInstall[ww.dep.path]) { - toInstall[ww.dep.path].push(ww.what) + var where = ww.dep.parent && ww.dep.parent.path || ww.dep.path + if (toInstall[where]) { + toInstall[where].push(ww.what) } else { - toInstall[ww.dep.path] = [ww.what] + toInstall[where] = [ww.what] } }) chain(Object.keys(toInstall).map(function (where) { |