From 4333f3e17db73402cd9dd7e07ee1373c95095722 Mon Sep 17 00:00:00 2001 From: OrigamingWasTaken <74014262+OrigamingWasTaken@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:26:04 +0200 Subject: [PATCH] Fix dmg build --- scripts/build/ts/dmg.ts | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/scripts/build/ts/dmg.ts b/scripts/build/ts/dmg.ts index 462bf1f..823b627 100644 --- a/scripts/build/ts/dmg.ts +++ b/scripts/build/ts/dmg.ts @@ -39,7 +39,7 @@ async function createCustomDMG(options: DmgOptions) { `--window-pos ${windowPos || "200 120"}`, // Default to '200 120' if not provided `--window-size ${windowSize || "800 400"}`, // Default to '800 400' if not provided `--text-size ${textSize || 12}`, // Default to 12 if not provided - `--icon-size ${iconSize || 100}`, // Default to 100 + `--icon-size ${iconSize || 100}`, // Default to 100 iconPos ? `--icon "${BuildConfig.appName}.app" ${iconPos}` : "", // Icon position (left, y centered) `--app-drop-link ${appDropLink || "600 120"}`, // Default to '600 120' (right side) if not provided `"${outputName}.dmg"`, @@ -54,8 +54,8 @@ async function createCustomDMG(options: DmgOptions) { console.log("DMG created successfully"); } catch (error) { console.error("Failed to create DMG:", error); - console.error(error) - throw new Error("Failed to create dmg:\n" + error) + console.error(error); + throw new Error("Failed to create dmg:\n" + error); } } @@ -90,20 +90,22 @@ async function build() { return; } - await createCustomDMG({ - sourceFolder: appFolder, - outputName: path.join(path.resolve("./dist"), `${BuildConfig.appName}-${version}_${app}`), - volumeName: `${BuildConfig.appName}_${app}`, - backgroundPath: path.resolve("./build/assets/bg.png"), - windowPos: "200 120", - windowSize: "600 360", - iconSize: 90, - iconPos: "160 180", - appDropLink: "440 180", - }).catch(()=>{ - l.fatal(`failed to package mac_${app}, skipping.`) - break; - }); + try { + await createCustomDMG({ + sourceFolder: appFolder, + outputName: path.join(path.resolve("./dist"), `${BuildConfig.appName}-${version}_${app}`), + volumeName: BuildConfig.appName, + backgroundPath: path.resolve("./build/assets/bg.png"), + windowPos: "200 120", + windowSize: "600 360", + iconSize: 90, + iconPos: "160 180", + appDropLink: "440 180", + }); + } catch (err) { + l.fatal(`failed to package mac_${app}, skipping.`); + continue; + } l.complete(`mac_${app} packaged in ${((performance.now() - appTime) / 1000).toFixed(3)}s`); console.log("");