Skip to content

Commit 2858dd9

Browse files
Use electron's arm64 detection
1 parent dce9f14 commit 2858dd9

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

app/updater.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,9 @@ let isInit = false;
3535
// Default to the "stable" update channel
3636
let canaryUpdates = false;
3737

38-
// Detect if we are running inside Rosetta emulation
39-
const isRosetta = () => {
40-
if (platform !== 'darwin') {
41-
return false;
42-
}
43-
const sysctlRosettaInfoKey = 'sysctl.proc_translated';
44-
let results = '';
45-
try {
46-
results = execSync(`sysctl ${sysctlRosettaInfoKey}`).toString();
47-
} catch (error) {
48-
console.log('Failed to detect Rosetta');
49-
}
50-
return results.includes(`${sysctlRosettaInfoKey}: 1`);
51-
};
52-
5338
const buildFeedUrl = (canary: boolean, currentVersion: string) => {
5439
const updatePrefix = canary ? 'releases-canary' : 'releases';
55-
const archSuffix = process.arch === 'arm64' || isRosetta() ? '_arm64' : '';
40+
const archSuffix = process.arch === 'arm64' || app.runningUnderARM64Translation ? '_arm64' : '';
5641
return `https://${updatePrefix}.hyper.is/update/${isLinux ? 'deb' : platform}${archSuffix}/${currentVersion}`;
5742
};
5843

0 commit comments

Comments
 (0)