Skip to content

Commit

Permalink
Add support for downloading M1 Mac (aarch64) Chromium (#2668)
Browse files Browse the repository at this point in the history
Signed-off-by: Marques Lee <marques.lee@thoughtworks.com>

Signed-off-by: Marques Lee <marques.lee@thoughtworks.com>
Co-authored-by: Zabil Cheriya Maliackal <zabil@users.noreply.github.com>
  • Loading branch information
marques-work and zabil authored Dec 8, 2022
1 parent f09c80f commit 59eefb8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/browserFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ const readline = require('readline');
var url = require('url');
const ProxyAgent = require('https-proxy-agent');
const getProxyForUrl = require('proxy-from-env').getProxyForUrl;
const supportedPlatforms = ['mac', 'linux', 'win32', 'win64'];
const supportedPlatforms = ['mac', 'mac_arm', 'linux', 'win32', 'win64'];
const DEFAULT_DOWNLOAD_HOST = 'https://storage.googleapis.com';
const downloadURLs = {
linux: '%s/chromium-browser-snapshots/Linux_x64/%d/%s.zip',
mac: '%s/chromium-browser-snapshots/Mac/%d/%s.zip',
mac_arm: '%s/chromium-browser-snapshots/Mac_Arm/%d/%s.zip',
win32: '%s/chromium-browser-snapshots/Win/%d/%s.zip',
win64: '%s/chromium-browser-snapshots/Win_x64/%d/%s.zip',
};
Expand All @@ -54,7 +55,7 @@ function archiveName(platform, revision) {
if (platform === 'linux') {
return 'chrome-linux';
}
if (platform === 'mac') {
if (platform === 'mac' || platform === 'mac_arm') {
return 'chrome-mac';
}
if (platform === 'win32' || platform === 'win64') {
Expand All @@ -79,7 +80,7 @@ class BrowserFetcher {
if (!this._platform) {
const platform = os.platform();
if (platform === 'darwin') {
this._platform = 'mac';
this._platform = os.arch() === 'arm64' ? 'mac_arm' : 'mac';
} else if (platform === 'linux') {
this._platform = 'linux';
} else if (platform === 'win32') {
Expand Down Expand Up @@ -180,7 +181,7 @@ class BrowserFetcher {
revisionInfo(revision) {
const folderPath = this._getFolderPath(revision);
let executablePath = '';
if (this._platform === 'mac') {
if (this._platform === 'mac' || this._platform === 'mac_arm') {
executablePath = path.join(
folderPath,
archiveName(this._platform, revision),
Expand Down

0 comments on commit 59eefb8

Please sign in to comment.