Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shell): find user CLIs when POSIX PATH probes fail #24632

Openjuliusmarmingewants to merge 4 commits intomain fromtakeover/pr-9232opened View on GitHub

Showing 5 changed files with 121 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
58 additions and 0 deletionsapps/desktop/src/shell/DesktopShellEnvironment.test.tsModified
View file
@@ -2,6 +2,7 @@
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, describe, it } from "@effect/vitest";
import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
import * as Layer from "effect/Layer";
import * as Logger from "effect/Logger";
import * as PlatformError from "effect/PlatformError";
@@ -282,6 +283,63 @@
}),
​
+ // The inherited PATH already holds the platform's absolute fallback dirs, so each
+ // case only depends on whether the fixture HOME has ~/.local/bin, not on this host.
+ it.effect.each([
+ { platform: "linux", brewBin: "/home/linuxbrew/.linuxbrew/bin" },
+ { platform: "darwin", brewBin: "/opt/homebrew/bin" },
+ ] as const)(
+ "falls back to existing CLI dirs when probes return no PATH on $platform",
+ ({ platform, brewBin }) =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const cases = [
+ {
+ localBin: true,
+ inherited: (home: string) =>
+ `${home}/.nvm/bin:/usr/local/bin:/usr/bin:${brewBin}:/usr/bin`,
+ probe: "",
+ expected: (home: string) =>