diff --git a/scripts/finalize-desktop-artifacts.mjs b/scripts/finalize-desktop-artifacts.mjs index 3931e8f..4fb923a 100644 --- a/scripts/finalize-desktop-artifacts.mjs +++ b/scripts/finalize-desktop-artifacts.mjs @@ -22,7 +22,10 @@ import { import { codesignMacAppBundle } from "./codesign-macos-app.mjs"; import { prepareWindowsAppBinaries } from "./prepare-windows-app-binaries.mjs"; -const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); +const rootDir = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + "..", +); const packageJson = JSON.parse( readFileSync(path.join(rootDir, "package.json"), "utf8"), ); @@ -36,9 +39,7 @@ const targetOs = : process.platform === "linux" ? "linux" : null); -const buildArch = getReleaseArch( - process.env.ELECTROBUN_ARCH || process.arch, -); +const buildArch = getReleaseArch(process.env.ELECTROBUN_ARCH || process.arch); const version = process.env.ELECTROBUN_APP_VERSION || getReleaseVersion(packageJson); const artifactDir = @@ -197,8 +198,8 @@ const MAC_DMG_BACKGROUND_RETINA_PATH = path.join( "assets/dmg/background@2x.png", ); const MAC_DMG_APP_NAME = "Farm Control Server.app"; -const MAC_DMG_WINDOW_WIDTH = 380; -const MAC_DMG_WINDOW_HEIGHT = 540; +const MAC_DMG_WINDOW_WIDTH = 540; +const MAC_DMG_WINDOW_HEIGHT = 380; function ensureMacDmgAssets() { mkdirSync(MAC_DMG_ASSETS_DIR, { recursive: true }); @@ -327,8 +328,7 @@ function canUseDirectDmgSourceFolder(appBundlePath) { const platformDir = path.dirname(appBundlePath); const appName = path.basename(appBundlePath); const entries = readdirSync(platformDir).filter( - (entry) => - !entry.startsWith(".") && entry !== ".finalize-dmg-staging", + (entry) => !entry.startsWith(".") && entry !== ".finalize-dmg-staging", ); return entries.length === 1 && entries[0] === appName; @@ -368,10 +368,7 @@ async function buildMacDmg(appBundlePath, arch) { if (!useDirectSource) { rmSync(stagingDir, { recursive: true, force: true }); mkdirSync(stagingDir, { recursive: true }); - const stagedAppPath = path.join( - stagingDir, - path.basename(appBundlePath), - ); + const stagedAppPath = path.join(stagingDir, path.basename(appBundlePath)); copyMacAppBundle(appBundlePath, stagedAppPath); codesignMacAppBundle(stagedAppPath); } @@ -449,16 +446,15 @@ function buildWindowsNsis(appDir, arch) { artifactDir, getReleaseArtifactName(version, arch, "exe"), ); - const powershell = - process.env.SystemRoot - ? path.join( - process.env.SystemRoot, - "System32", - "WindowsPowerShell", - "v1.0", - "powershell.exe", - ) - : "powershell.exe"; + const powershell = process.env.SystemRoot + ? path.join( + process.env.SystemRoot, + "System32", + "WindowsPowerShell", + "v1.0", + "powershell.exe", + ) + : "powershell.exe"; const result = spawnSync( powershell, @@ -494,16 +490,15 @@ function buildWindowsMsi(setupExePath, arch) { artifactDir, getReleaseArtifactName(version, arch, "msi"), ); - const powershell = - process.env.SystemRoot - ? path.join( - process.env.SystemRoot, - "System32", - "WindowsPowerShell", - "v1.0", - "powershell.exe", - ) - : "powershell.exe"; + const powershell = process.env.SystemRoot + ? path.join( + process.env.SystemRoot, + "System32", + "WindowsPowerShell", + "v1.0", + "powershell.exe", + ) + : "powershell.exe"; const result = spawnSync( powershell,