From bb538fe4544478c8a091f65b2f22b1d719856a0b Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Tue, 28 Jul 2026 22:18:27 +0100 Subject: [PATCH] Refactor Linux binary build script for improved exit code handling - Updated the exit code handling in the Linux binary build script to use the `exited` property from the compile result. - Simplified the process of exiting the script on failure, enhancing clarity and reliability. --- scripts/build-linux-binary.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build-linux-binary.mjs b/scripts/build-linux-binary.mjs index 87ea62e..623d381 100644 --- a/scripts/build-linux-binary.mjs +++ b/scripts/build-linux-binary.mjs @@ -49,7 +49,7 @@ if (!result.success) { process.exit(1); } -const compileResult = await Bun.spawn([ +const compileResult = Bun.spawn([ "bun", "build", "--compile", @@ -63,8 +63,9 @@ const compileResult = await Bun.spawn([ stderr: "inherit", }); -if (compileResult.exitCode !== 0) { - process.exit(compileResult.exitCode ?? 1); +const exitCode = await compileResult.exited; +if (exitCode !== 0) { + process.exit(exitCode); } console.log(`Linux binary written to ${outputFile}`);