From 98d79a66b75461794b2a9db28b6d7babbf79be60 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Mon, 21 Dec 2020 16:37:55 -0800 Subject: [PATCH] fix(webkit): properly detect arm64 on apple silicon (#4783) --- src/utils/browserPaths.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/browserPaths.ts b/src/utils/browserPaths.ts index ac8891f58ba95..e52b68fd0a479 100644 --- a/src/utils/browserPaths.ts +++ b/src/utils/browserPaths.ts @@ -35,7 +35,13 @@ export const hostPlatform = ((): BrowserPlatform => { const macVersion = execSync('sw_vers -productVersion', { stdio: ['ignore', 'pipe', 'ignore'] }).toString('utf8').trim().split('.').slice(0, 2).join('.'); - const archSuffix = os.arch() === 'arm64' ? '-arm64' : ''; + let arm64 = false; + if (!macVersion.startsWith('10.')) { + arm64 = execSync('sysctl -in hw.optional.arm64', { + stdio: ['ignore', 'pipe', 'ignore'] + }).toString().trim() === '1'; + } + const archSuffix = arm64 ? '-arm64' : ''; return `mac${macVersion}${archSuffix}` as BrowserPlatform; } if (platform === 'linux') {