diff options
author | Maximilian Antoni <maximilian.antoni@juliusbaer.com> | 2013-09-05 16:44:05 +0400 |
---|---|---|
committer | Domenic Denicola <domenic@domenicdenicola.com> | 2013-09-08 07:36:22 +0400 |
commit | 90e8eec62da232b33df8f5946aad92cf3dca646d (patch) | |
tree | 19158b98ff0e03a6bd13cca9bd1e6a009e93d191 /lib/dedupe.js | |
parent | 2ce74ff424a2526602128bc39c5eacce07b3b9c9 (diff) |
dedupe: respect --tag
Diffstat (limited to 'lib/dedupe.js')
-rw-r--r-- | lib/dedupe.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/dedupe.js b/lib/dedupe.js index 648397b7a..34e71177c 100644 --- a/lib/dedupe.js +++ b/lib/dedupe.js @@ -248,7 +248,14 @@ function findVersions (npm, summary, cb) { npm.registry.get(name, function (er, data) { var regVersions = er ? [] : Object.keys(data.versions) var locMatch = bestMatch(versions, ranges) - var regMatch = bestMatch(regVersions, ranges) + var regMatch; + var tag = npm.config.get("tag"); + var distTags = data["dist-tags"]; + if (distTags && distTags[tag] && data.versions[distTags[tag]]) { + regMatch = distTags[tag] + } else { + regMatch = bestMatch(regVersions, ranges) + } cb(null, [[name, has, loc, locMatch, regMatch, locs]]) }) |