diff options
author | Matt Lunn <matt@mattlunn.me.uk> | 2013-06-02 02:35:10 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-06-17 19:07:43 +0400 |
commit | 54e0f439cdecb286a001a42c30d99b401efc1256 (patch) | |
tree | 46cc1354ae50faec15add47db50e9c51a9c4bc44 | |
parent | 83ce47740e9cd477d064acaadcb15448bc5f2c18 (diff) |
Use git repo or tarball as update source
-rw-r--r-- | lib/outdated.js | 2 | ||||
-rw-r--r-- | lib/update.js | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index e3ef5b1e4..038f18bfa 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -138,7 +138,7 @@ function shouldUpdate (args, dir, dep, has, req, cb) { } function doIt (shouldHave) { - cb(null, [[ dir, dep, has[dep], shouldHave ]]) + cb(null, [[ dir, dep, has[dep], shouldHave, req ]]) } if (args.length && args.indexOf(dep) === -1) { diff --git a/lib/update.js b/lib/update.js index 46d32678e..68e01955a 100644 --- a/lib/update.js +++ b/lib/update.js @@ -27,12 +27,16 @@ function update (args, cb) { if (er) return cb(er) asyncMap(outdated, function (ww, cb) { - // [[ dir, dep, has, want ]] + // [[ dir, dep, has, want, req ]] var where = ww[0] , dep = ww[1] , want = ww[3] , what = dep + "@" + want + , req = ww[4] + , url = require('url') + // use the initial installation method (repo, tar, git) for updating + if (url.parse(req).protocol) what = req npm.commands.install(where, what, cb) }, cb) }) |