Add the ability to build the app as a dir

This commit is contained in:
Dimitris Zervas
2024-12-19 20:37:23 +02:00
parent 8b4b4b8417
commit cd483e2cd1

View File

@@ -6,6 +6,7 @@ import { BuildTarget, getDistPlatform } from './platform/build-platforms';
(async function () {
// Inputs
const DISABLE_SIGNING = valueToBoolean(process.env.DISABLE_SIGNING);
const BUILD_AS_DIR = valueToBoolean(process.env.BUILD_AS_DIR);
const TARGET_PLATFORM = process.env.TARGET_PLATFORM;
if (!TARGET_PLATFORM) throw new Error('TARGET_PLATFORM is falsy');
@@ -39,10 +40,14 @@ import { BuildTarget, getDistPlatform } from './platform/build-platforms';
console.log('--- done!');
const platformName = getDistPlatform(target.platform);
const args = [`--${platformName}`, `--${target.arch}`].join(' ');
let args = [`--${target.arch}`, `--${platformName}`];
if (BUILD_AS_DIR === true) {
args.push('--dir');
}
const argsStr = args.join(' ');
console.log(`--- Run: 'npx electron-builder ${args}' ...`);
execSync('npx electron-builder ' + args, {
console.log(`--- Run: 'npx electron-builder ${argsStr}' ...`);
execSync('npx electron-builder ' + argsStr, {
stdio: [0, 1, 2],
env: Object.assign(
DISABLE_SIGNING