Skip to content

Commit 6a7743e

Browse files
committed
fix(desktop): simplify the shell preparation result
1 parent 637c93d commit 6a7743e

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

‎apps/desktop/src/shell/DesktopShellEnvironment.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ describe("DesktopShellEnvironment", () => {
286286

287287
it.effect("leaves macOS preparation incomplete when no login shell returns a PATH", () =>
288288
Effect.gen(function* () {
289-
// A probe that times out yields the same empty output as this reply.
290289
const prepared = yield* runShellEnvironment({
291290
env: { SHELL: "/bin/zsh", PATH: "/usr/bin:/bin:/usr/sbin:/sbin" },
292291
platform: "darwin",

‎apps/desktop/src/shell/DesktopShellEnvironment.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,8 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
410410
config.platform === "darwin" && !shellEnvironment.PATH
411411
? yield* readLaunchctlPath
412412
: Option.none<string>();
413-
const shellPath = trimNonEmpty(shellEnvironment.PATH);
414413
const mergedPath = mergePaths(config.platform, [
415-
shellPath.pipe(Option.orElse(() => launchctlPath)),
414+
trimNonEmpty(shellEnvironment.PATH).pipe(Option.orElse(() => launchctlPath)),
416415
readEnvPath(config.env),
417416
]);
418417

@@ -491,9 +490,7 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
491490
}
492491
}
493492

494-
// Only a login-shell PATH counts; a launchctl-only PATH still leaves
495-
// server hydration enabled.
496-
return Option.isSome(shellPath);
493+
return Option.isSome(trimNonEmpty(shellEnvironment.PATH));
497494
},
498495
);
499496

0 commit comments

Comments
 (0)