From a1c7b98f98b69242b50e9df2916d1d8161e9af48 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 2 Mar 2026 20:59:56 -0800 Subject: [PATCH] fix build script --- scripts/build-desktop-artifact.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 76f926549705b00feed904bde98f13c1adf570a2..a54bd41d08ce1f37ed7fe2c87ddec96c342a015b 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -10,7 +10,7 @@ import * as NodeRuntime from "@effect/platform-node/NodeRuntime"; import * as NodeServices from "@effect/platform-node/NodeServices"; import { Config, Data, Effect, FileSystem, Logger, Option, Path, Schema } from "effect"; import { Command, Flag } from "effect/unstable/cli"; -import { ChildProcess } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; const BuildPlatform = Schema.Literals(["mac", "linux", "win"]); const BuildArch = Schema.Literals(["arm64", "x64", "universal"]); @@ -134,14 +134,12 @@ const AzureTrustedSigningOptionsConfig = Config.all({ endpoint: Config.string("AZURE_TRUSTED_SIGNING_ENDPOINT"), certificateProfileName: Config.string("AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME"), codeSigningAccountName: Config.string("AZURE_TRUSTED_SIGNING_ACCOUNT_NAME"), - fileDigest: Config.string("AZURE_TRUSTED_SIGNING_FILE_DIGEST").pipe( - Config.withDefault(() => "SHA256"), - ), + fileDigest: Config.string("AZURE_TRUSTED_SIGNING_FILE_DIGEST").pipe(Config.withDefault("SHA256")), timestampDigest: Config.string("AZURE_TRUSTED_SIGNING_TIMESTAMP_DIGEST").pipe( - Config.withDefault(() => "SHA256"), + Config.withDefault("SHA256"), ), timestampRfc3161: Config.string("AZURE_TRUSTED_SIGNING_TIMESTAMP_RFC3161").pipe( - Config.withDefault(() => "http://timestamp.acs.microsoft.com"), + Config.withDefault("http://timestamp.acs.microsoft.com"), ), }); @@ -151,10 +149,10 @@ const BuildEnvConfig = Config.all({ arch: Config.schema(BuildArch, "T3CODE_DESKTOP_ARCH").pipe(Config.option), version: Config.string("T3CODE_DESKTOP_VERSION").pipe(Config.option), outputDir: Config.string("T3CODE_DESKTOP_OUTPUT_DIR").pipe(Config.option), - skipBuild: Config.boolean("T3CODE_DESKTOP_SKIP_BUILD").pipe(Config.withDefault(() => false)), - keepStage: Config.boolean("T3CODE_DESKTOP_KEEP_STAGE").pipe(Config.withDefault(() => false)), - signed: Config.boolean("T3CODE_DESKTOP_SIGNED").pipe(Config.withDefault(() => false)), - verbose: Config.boolean("T3CODE_DESKTOP_VERBOSE").pipe(Config.withDefault(() => false)), + skipBuild: Config.boolean("T3CODE_DESKTOP_SKIP_BUILD").pipe(Config.withDefault(false)), + keepStage: Config.boolean("T3CODE_DESKTOP_KEEP_STAGE").pipe(Config.withDefault(false)), + signed: Config.boolean("T3CODE_DESKTOP_SIGNED").pipe(Config.withDefault(false)), + verbose: Config.boolean("T3CODE_DESKTOP_VERBOSE").pipe(Config.withDefault(false)), }); const resolveBooleanFlag = (flag: Option.Option, envValue: boolean) => @@ -209,11 +207,13 @@ const commandOutputOptions = (verbose: boolean) => }) as const; const runCommand = Effect.fn(function* (command: ChildProcess.Command) { - const exitCode = yield* ChildProcess.exitCode(command); + const commandSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; + const child = yield* commandSpawner.spawn(command); + const exitCode = yield* child.exitCode; if (exitCode !== 0) { return yield* new BuildScriptError({ - message: "Command exited with non-zero exit code", + message: `Command exited with non-zero exit code (${exitCode})`, }); } }); -- 2.54.0