Skip to content

Commit

Permalink
Fixes downloading on m1 macs from version 106.0.5249.61 (#239)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay McCure <jmccure@gitlab.com>
  • Loading branch information
jmccure and Jay McCure authored Sep 29, 2022
1 parent 268827f commit 31f10f7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/webdrivers/chromedriver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ def apple_m1_compatible?(driver_version)
false
end

def apple_filename(driver_version)
if apple_m1_compatible?(driver_version)
driver_version >= normalize_version('106.0.5249.61') ? 'mac_arm64' : 'mac64_m1'
else
'mac64'
end
end

def direct_url(driver_version)
"#{base_url}/#{driver_version}/chromedriver_#{driver_filename(driver_version)}.zip"
end
Expand All @@ -107,8 +115,7 @@ def driver_filename(driver_version)
elsif System.platform == 'linux'
'linux64'
elsif System.platform == 'mac'
apple_arch = apple_m1_compatible?(driver_version) ? '_m1' : ''
"mac64#{apple_arch}"
apple_filename(driver_version)
else
raise 'Failed to determine driver filename to download for your OS.'
end
Expand Down

0 comments on commit 31f10f7

Please sign in to comment.