2023-02-05 18:51:47 +02:00
|
|
|
const execCommand = require('./execCommand');
|
2019-03-03 02:51:54 +02:00
|
|
|
|
|
|
|
const isWindows = () => {
|
|
|
|
return process && process.platform === 'win32';
|
2019-07-30 09:35:42 +02:00
|
|
|
};
|
2019-03-03 02:51:54 +02:00
|
|
|
|
|
|
|
async function main() {
|
|
|
|
// electron-rebuild --arch ia32 && electron-rebuild --arch x64
|
|
|
|
|
2020-11-10 17:59:30 +02:00
|
|
|
// console.warn('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
|
|
|
|
// console.warn('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ELECTRON REBUILD IS DISABLED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
|
|
|
|
// console.warn('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
|
2020-11-05 18:58:23 +02:00
|
|
|
// return;
|
|
|
|
|
2021-12-20 17:08:43 +02:00
|
|
|
// let exePath = `${__dirname}/../node_modules/.bin/electron-rebuild`;
|
|
|
|
// if (isWindows()) exePath += '.cmd';
|
2019-03-03 02:51:54 +02:00
|
|
|
|
2020-03-30 19:03:02 +02:00
|
|
|
process.chdir(`${__dirname}/..`);
|
|
|
|
|
2021-10-01 20:35:27 +02:00
|
|
|
// We need to force the ABI because Electron Builder or node-abi picks the
|
|
|
|
// wrong one. However it means it will have to be manually upgraded for each
|
|
|
|
// new Electron release. Some ABI map there:
|
|
|
|
// https://github.com/electron/node-abi/tree/master/test
|
|
|
|
const forceAbiArgs = '--force-abi 89';
|
|
|
|
|
2019-03-03 02:51:54 +02:00
|
|
|
if (isWindows()) {
|
2020-11-10 17:59:30 +02:00
|
|
|
// Cannot run this in parallel, or the 64-bit version might end up
|
|
|
|
// with 32-bit files and vice-versa
|
2021-12-20 17:08:43 +02:00
|
|
|
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs, '--arch ia32'].join(' ')));
|
|
|
|
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs, '--arch x64'].join(' ')));
|
2019-03-03 02:51:54 +02:00
|
|
|
} else {
|
2021-12-20 17:08:43 +02:00
|
|
|
console.info(await execCommand(['yarn', 'run', 'electron-rebuild', forceAbiArgs].join(' ')));
|
2019-07-30 09:35:42 +02:00
|
|
|
}
|
2019-03-03 02:51:54 +02:00
|
|
|
}
|
|
|
|
|
2020-02-21 00:59:18 +02:00
|
|
|
module.exports = main;
|