Skip to content

Commit

Permalink
Fix edge case of resolutions not working properly when resolving to b…
Browse files Browse the repository at this point in the history
…ranches, modifies bower#819, closes bower#818.
  • Loading branch information
Mike Spainhower committed Aug 26, 2013
1 parent a72c46f commit 8da2588
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/core/Manager.js
Expand Up @@ -636,8 +636,14 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
if (resolution && !unresolvable) {
if (semver.validRange(resolution)) {
suitable = mout.array.findIndex(picks, function (pick) {
return pick.pkgMeta.version &&
semver.satisfies(pick.pkgMeta.version, resolution);
var versionSatisfies;
var releaseSatisfies;
versionSatisfies = pick.pkgMeta.version &&
semver.satisfies(pick.pkgMeta.version, resolution);
releaseSatisfies = pick.pkgMeta._release &&
semver.validRange(pick.pkgMeta._release) &&
semver.satisfies(pick.pkgMeta._release, resolution);
return versionSatisfies || releaseSatisfies;
});
} else {
suitable = mout.array.findIndex(picks, function (pick) {
Expand Down

0 comments on commit 8da2588

Please sign in to comment.