From 887a553c3aebd303f16ee8bbf8cbe80245c75587 Mon Sep 17 00:00:00 2001 From: Captain Caius <241342+captaincaius@users.noreply.github.com> Date: Wed, 26 Feb 2020 18:32:45 +0200 Subject: [PATCH 1/2] fix #445 download highest sub-patch chromedriver --- lib/binaries/chrome_xml.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/binaries/chrome_xml.ts b/lib/binaries/chrome_xml.ts index 3ab6fca8..7c20ace9 100644 --- a/lib/binaries/chrome_xml.ts +++ b/lib/binaries/chrome_xml.ts @@ -101,7 +101,14 @@ export class ChromeXml extends XmlConfigSource { // For 64-bit systems, prefer the 64-bit version. else if (this.osarch === 'x64') { if (item.includes(this.getOsTypeName() + '64')) { - itemFound = item; + // Only override the previously found item if its sub-patch-version is less + // than that of the current candidate. + const itemFoundVersionParts = itemFound.split('/')[0].split('.'); + const versionParts = version.split('.'); + if (itemFoundVersionParts.length<4 || + (parseInt(versionParts[3] || '0')>parseInt(itemFoundVersionParts[3]))) { + itemFound = item; + } } } } From 1470e10699f6811a74d30a786f9ad30c7a6d5f7a Mon Sep 17 00:00:00 2001 From: Captain Caius <241342+captaincaius@users.noreply.github.com> Date: Wed, 26 Feb 2020 18:40:52 +0200 Subject: [PATCH 2/2] fix lint in chrome_xml --- lib/binaries/chrome_xml.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/binaries/chrome_xml.ts b/lib/binaries/chrome_xml.ts index 7c20ace9..b885bdcb 100644 --- a/lib/binaries/chrome_xml.ts +++ b/lib/binaries/chrome_xml.ts @@ -105,8 +105,8 @@ export class ChromeXml extends XmlConfigSource { // than that of the current candidate. const itemFoundVersionParts = itemFound.split('/')[0].split('.'); const versionParts = version.split('.'); - if (itemFoundVersionParts.length<4 || - (parseInt(versionParts[3] || '0')>parseInt(itemFoundVersionParts[3]))) { + if (itemFoundVersionParts.length < 4 || + (parseInt(versionParts[3] || '0') > parseInt(itemFoundVersionParts[3]))) { itemFound = item; } }