Permalink
Browse files

[fix] handle version numbers with build details properly

fixes #44
  • Loading branch information...
1 parent 86e9cdf commit 35e2fbd62dd7a6a422a0c5f741a93d2ac53031b7 @fb55 fb55 committed Aug 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/require-analyzer.js
@@ -641,7 +641,7 @@ analyzer.extractVersions = function (dependencies) {
var raw = dependencies[pkg] || '*',
parse = semver.expressions.parse.exec(raw.trim()),
version = parse ? parse.slice(1) : raw,
- build = version ? version[4] : null;
+ build = version ? version[3] : null;
if (!/^[v\d]+/.test(raw)) {
all[pkg] = raw;
}
@@ -650,7 +650,7 @@ analyzer.extractVersions = function (dependencies) {
}
else {
version[2] = build ? version[2] : 'x';
- all[pkg] = build ? '>= ' + dependencies[pkg].version : version.filter(Boolean).join('.');
+ all[pkg] = build ? '>= ' + dependencies[pkg] : version.filter(Boolean).join('.');
}
});

0 comments on commit 35e2fbd

Please sign in to comment.