add multi-architecture support for MacOS

This commit is contained in:
Tlntin
2023-01-26 11:49:18 +08:00
parent 7c07d3f227
commit 92c900d4ff
2 changed files with 8 additions and 8 deletions

View File

@@ -45,13 +45,13 @@ export default class MacBuilder implements IBuilder {
dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
} else {
await shellExec(`cd ${npmDirectory} && npm install && npm run build`);
let arch: string;
if (process.arch === "x64") {
arch = "amd64";
let arch = "x64";
if (process.arch === "arm64") {
arch = "aarch64";
} else {
arch = process.arch;
}
dmgName = `${name}_${tauriConf.package.version}_${arch}.deb`;
dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
}
const appPath = this.getBuildAppPath(npmDirectory, dmgName);
const distPath = path.resolve(`${name}.dmg`);

8
dist/cli.js vendored
View File

@@ -2024,14 +2024,14 @@ class MacBuilder {
}
else {
yield shellExec(`cd ${npmDirectory} && npm install && npm run build`);
let arch;
if (process.arch === "x64") {
arch = "amd64";
let arch = "x64";
if (process.arch === "arm64") {
arch = "aarch64";
}
else {
arch = process.arch;
}
dmgName = `${name}_${tauriConf.package.version}_${arch}.deb`;
dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
}
const appPath = this.getBuildAppPath(npmDirectory, dmgName);
const distPath = path.resolve(`${name}.dmg`);