Skip to content

Commit

Permalink
Install the arm64 binary if we are on an arm64 macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Nov 26, 2023
1 parent 9a464f3 commit 964ab84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion install.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const pkg = require('./package');
const { DownloaderHelper } = require('node-downloader-helper');
const { promisify } = require('util');
const tar = require('tar');
const semver = require('semver');
const unlink = promisify(fs.unlink);
const mkdir = promisify(fs.mkdir);
const chmod = promisify(fs.chmod);
Expand Down Expand Up @@ -42,7 +43,13 @@ function getDriverUrl() {

switch (os.platform()) {
case 'darwin':
return `${urlBase}geckodriver-${GECKODRIVER_VERSION}-macos.tar.gz`;
// Starting from Geckodriver v0.29.1, there is a separate build for arm64
// architecture. Let's install it if we are on arm64 as well.
const arch =
os.arch() === 'arm64' && semver.gte(GECKODRIVER_VERSION, '0.29.1')
? '-aarch64'
: '';
return `${urlBase}geckodriver-${GECKODRIVER_VERSION}-macos${arch}.tar.gz`;
case 'linux': {
if (os.arch() === 'arm') {
// Don't want to spend hours to build a new one, so for now serve 0.29.0
Expand Down

0 comments on commit 964ab84

Please sign in to comment.