Improve Rosetta detection
This commit is contained in:
parent
3b70f4b0f1
commit
b8cd326bc9
2 changed files with 7 additions and 3 deletions
|
@ -50,11 +50,12 @@ async function go() {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Notarizing with...');
|
console.log('Notarizing with...');
|
||||||
console.log(` files: ${appPaths.join(', ')}`);
|
|
||||||
console.log(` primaryBundleId: ${appBundleId}`);
|
console.log(` primaryBundleId: ${appBundleId}`);
|
||||||
console.log(` username: ${appleId}`);
|
console.log(` username: ${appleId}`);
|
||||||
|
|
||||||
for (const appPath of appPaths) {
|
for (const appPath of appPaths) {
|
||||||
|
console.log(` file: ${appPath}`);
|
||||||
|
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await notarize({
|
await notarize({
|
||||||
appBundleId,
|
appBundleId,
|
||||||
|
|
|
@ -390,13 +390,16 @@ export abstract class Updater {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// We might be running under Rosetta
|
// We might be running under Rosetta
|
||||||
if (promisify(execFile)('uname', ['-m']).toString().trim() === 'arm64') {
|
const flag = 'sysctl.proc_translated';
|
||||||
|
const { stdout } = await promisify(execFile)('sysctl', ['-i', flag]);
|
||||||
|
|
||||||
|
if (stdout.includes(`${flag}: 1`)) {
|
||||||
this.logger.info('updater: running under Rosetta');
|
this.logger.info('updater: running under Rosetta');
|
||||||
return 'arm64';
|
return 'arm64';
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.warn(
|
this.logger.warn(
|
||||||
`updater: "uname -m" failed with ${Errors.toLogFormat(error)}`
|
`updater: Rosetta detection failed with ${Errors.toLogFormat(error)}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue