authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 20:59:56-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 20:59:56-08:00
loga1c7b98f98b69242b50e9df2916d1d8161e9af48
tree19cc3fff3534487a252a3dafedb82db4aa793cb4
parent99ea16a9696e95065c8b556f78468a07712d97d3

fix build script


1 files changed, 12 insertions(+), 12 deletions(-)

scripts/build-desktop-artifact.ts+12-12
......@@ -10,7 +10,7 @@ import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
1010import * as NodeServices from "@effect/platform-node/NodeServices";
1111import { Config, Data, Effect, FileSystem, Logger, Option, Path, Schema } from "effect";
1212import { Command, Flag } from "effect/unstable/cli";
13import { ChildProcess } from "effect/unstable/process";
13import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
1414
1515const BuildPlatform = Schema.Literals(["mac", "linux", "win"]);
1616const BuildArch = Schema.Literals(["arm64", "x64", "universal"]);
......@@ -134,14 +134,12 @@ const AzureTrustedSigningOptionsConfig = Config.all({
134134 endpoint: Config.string("AZURE_TRUSTED_SIGNING_ENDPOINT"),
135135 certificateProfileName: Config.string("AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME"),
136136 codeSigningAccountName: Config.string("AZURE_TRUSTED_SIGNING_ACCOUNT_NAME"),
137 fileDigest: Config.string("AZURE_TRUSTED_SIGNING_FILE_DIGEST").pipe(
138 Config.withDefault(() => "SHA256"),
139 ),
137 fileDigest: Config.string("AZURE_TRUSTED_SIGNING_FILE_DIGEST").pipe(Config.withDefault("SHA256")),
140138 timestampDigest: Config.string("AZURE_TRUSTED_SIGNING_TIMESTAMP_DIGEST").pipe(
141 Config.withDefault(() => "SHA256"),
139 Config.withDefault("SHA256"),
142140 ),
143141 timestampRfc3161: Config.string("AZURE_TRUSTED_SIGNING_TIMESTAMP_RFC3161").pipe(
144 Config.withDefault(() => "http://timestamp.acs.microsoft.com"),
142 Config.withDefault("http://timestamp.acs.microsoft.com"),
145143 ),
146144});
147145
......@@ -151,10 +149,10 @@ const BuildEnvConfig = Config.all({
151149 arch: Config.schema(BuildArch, "T3CODE_DESKTOP_ARCH").pipe(Config.option),
152150 version: Config.string("T3CODE_DESKTOP_VERSION").pipe(Config.option),
153151 outputDir: Config.string("T3CODE_DESKTOP_OUTPUT_DIR").pipe(Config.option),
154 skipBuild: Config.boolean("T3CODE_DESKTOP_SKIP_BUILD").pipe(Config.withDefault(() => false)),
155 keepStage: Config.boolean("T3CODE_DESKTOP_KEEP_STAGE").pipe(Config.withDefault(() => false)),
156 signed: Config.boolean("T3CODE_DESKTOP_SIGNED").pipe(Config.withDefault(() => false)),
157 verbose: Config.boolean("T3CODE_DESKTOP_VERBOSE").pipe(Config.withDefault(() => false)),
152 skipBuild: Config.boolean("T3CODE_DESKTOP_SKIP_BUILD").pipe(Config.withDefault(false)),
153 keepStage: Config.boolean("T3CODE_DESKTOP_KEEP_STAGE").pipe(Config.withDefault(false)),
154 signed: Config.boolean("T3CODE_DESKTOP_SIGNED").pipe(Config.withDefault(false)),
155 verbose: Config.boolean("T3CODE_DESKTOP_VERBOSE").pipe(Config.withDefault(false)),
158156});
159157
160158const resolveBooleanFlag = (flag: Option.Option<boolean>, envValue: boolean) =>
......@@ -209,11 +207,13 @@ const commandOutputOptions = (verbose: boolean) =>
209207 }) as const;
210208
211209const runCommand = Effect.fn(function* (command: ChildProcess.Command) {
212 const exitCode = yield* ChildProcess.exitCode(command);
210 const commandSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
211 const child = yield* commandSpawner.spawn(command);
212 const exitCode = yield* child.exitCode;
213213
214214 if (exitCode !== 0) {
215215 return yield* new BuildScriptError({
216 message: "Command exited with non-zero exit code",
216 message: `Command exited with non-zero exit code (${exitCode})`,
217217 });
218218 }
219219});