Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): use the host platform for launcher PATH lookup #20210

ClosedAlb11747(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/20210/headopened View on GitHub

Showing 1 changed file with 4 additions and 2 deletions.

x
0 of 1 viewed, 1 left
4 additions and 2 deletionsapps/server/src/cli/update.test.tsModified
View file
@@ -72,6 +72,8 @@
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
+ const platform = yield* HostProcess.Platform;
+ const delimiter = platform === "win32" ? ";" : ":";
const root = yield* fs.makeTempDirectoryScoped({ prefix: "t3-update-" });
const launcher = path.join(root, "bin/t3");
yield* fs.makeDirectory(path.dirname(launcher), { recursive: true });
@@ -80,7 +82,7 @@
const bare = yield* resolveLauncherPath.pipe(
Effect.provideService(HostProcess.InvokedAs, "t3"),
Effect.provideService(HostProcess.Environment, {
- PATH: `${path.join(root, "missing")}:${path.join(root, "bin")}`,
+ PATH: [path.join(root, "missing"), path.join(root, "bin")].join(delimiter),
}),
Effect.provideService(HostProcess.WorkingDirectory, root),
);
@@ -98,6 +100,6 @@
assert.equal(bare, launcher);
assert.equal(relative, launcher);
assert.equal(absent, undefined);
- }).pipe(Effect.scoped, Effect.provideService(HostProcess.Platform, "linux")),
+ }).pipe(Effect.scoped),
});