Skip to content

Commit

Permalink
Fix version finder
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr committed Jul 13, 2015
1 parent 31c2e8d commit cec72ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ versions.find = function(version_spec, list, cb) {
}else
if(~version_spec.indexOf('iojs')) {
version_spec = version_spec.substr('iojsv'.length)
if(i >= 0) do { v = list[i--] }while(v && ( !semver.satisfies(v, version_spec) || !~v.indexOf('iojs')) && i >= 0);
if(!semver.satisfies(v, version_spec) || !~v.indexOf('iojs') ) v = null;
if(i >= 0) do { v = list[i--] }while(v && ( !~v.indexOf('iojs') || !semver.satisfies(v.substr('iojsv'.length), version_spec)) && i >= 0);
if(!semver.satisfies(v.substr('iojsv'.length), version_spec) || !~v.indexOf('iojs') ) v = null;
}else{
if(~version_spec.indexOf('node')) version_spec = version_spec.substr('nodev'.length)
if(i >= 0) do { v = list[i--] }while(v && !semver.satisfies(v, version_spec) && i >= 0);
if(!semver.satisfies(v, version_spec)) v = null;
if(i >= 0) do { v = list[i--] }while(v && ( !~v.indexOf('node') || !semver.satisfies(v.substr('nodev'.length), version_spec) ) && i >= 0);
if(!semver.satisfies(v.substr('nodev'.length), version_spec)) v = null;
}
if(!v) return cb(new Error('Version spec, "' + version_spec + '", didn\'t match any available version'));
cb(null, v);
Expand Down

0 comments on commit cec72ff

Please sign in to comment.