Skip to content

Commit

Permalink
fix(webkit): properly detect arm64 on apple silicon (microsoft#4783)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Dec 22, 2020
1 parent 73edf13 commit ff2a1f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/browserPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit ff2a1f1

Please sign in to comment.