Skip to content

Commit a1c7b98

Browse files
fix build script
1 parent 99ea16a commit a1c7b98

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

scripts/build-desktop-artifact.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
1010
import * as NodeServices from "@effect/platform-node/NodeServices";
1111
import { Config, Data, Effect, FileSystem, Logger, Option, Path, Schema } from "effect";
1212
import { Command, Flag } from "effect/unstable/cli";
13-
import { ChildProcess } from "effect/unstable/process";
13+
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
1414

1515
const BuildPlatform = Schema.Literals(["mac", "linux", "win"]);
1616
const 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

160158
const resolveBooleanFlag = (flag: Option.Option<boolean>, envValue: boolean) =>
@@ -209,11 +207,13 @@ const commandOutputOptions = (verbose: boolean) =>
209207
}) as const;
210208

211209
const 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
});

0 commit comments

Comments
 (0)