From cd483e2cd1199440c3fef4865672088b9aadf730 Mon Sep 17 00:00:00 2001 From: Dimitris Zervas Date: Thu, 19 Dec 2024 20:37:23 +0200 Subject: [PATCH] Add the ability to build the app as a dir --- packages/noodl-editor/scripts/build.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/noodl-editor/scripts/build.ts b/packages/noodl-editor/scripts/build.ts index 82cfd58..a6f1b14 100644 --- a/packages/noodl-editor/scripts/build.ts +++ b/packages/noodl-editor/scripts/build.ts @@ -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