Skip to content

Commit

Permalink
fix(gecko): add additional check for OS when getting latest (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnishina authored Jan 31, 2017
1 parent 3246dd4 commit 6209666
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions lib/binaries/gecko_driver_github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,26 @@ export class GeckoDriverGithub extends GithubApiConfigSource {
}

private getLatestGeckoDriverVersion(): Promise<BinaryUrl> {
return this.getVersionsLookup().then(versionsLookup => {
let latest = '';
for (let item of versionsLookup) {
let version = item.version.replace('v', '');
if (latest === '') {
latest = version;
} else if (semver.lt(latest, version)) {
latest = version;
return this.getJson().then(json => {
return this.getVersionsLookup().then(versionsLookup => {
let latest = '';
for (let item of versionsLookup) {
let version = item.version.replace('v', '');
let assetsArray = json[item.index].assets;

// check to make sure the version found has the OS
for (let asset of assetsArray) {
if ((asset.name as string).includes(this.oshelper())) {
if (latest === '') {
latest = version;
} else if (semver.lt(latest, version)) {
latest = version;
}
}
}
}
}
return this.getSpecificGeckoDrierVersion('v' + latest);
return this.getSpecificGeckoDrierVersion('v' + latest);
});
});
}

Expand Down

0 comments on commit 6209666

Please sign in to comment.