diff --git a/_scripts/build.js b/_scripts/build.js index 7052fca8..7d92b13b 100644 --- a/_scripts/build.js +++ b/_scripts/build.js @@ -7,13 +7,22 @@ const { name, productName } = require('../package.json') const args = process.argv let targets -var platform = os.platform() +const platform = os.platform() +const cpus = os.cpus() -if (platform == 'darwin') { - targets = Platform.MAC.createTarget() -} else if (platform == 'win32') { +if (platform === 'darwin') { + let arch = Arch.x64 + +// Macbook Air 2020 with M1 = 'Apple M1' + // Macbook Pro 2021 with M1 Pro = 'Apple M1 Pro' + if (cpus[0].model.startsWith('Apple')) { + arch = Arch.arm64 + } + + targets = Platform.MAC.createTarget(['dmg'], arch) +} else if (platform === 'win32') { targets = Platform.WINDOWS.createTarget() -} else if (platform == 'linux') { +} else if (platform === 'linux') { let arch = Arch.x64 if (args[2] === 'arm64') {