Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): find user-installed CLIs when shell probing fails #9232

ClosedCyberStefNef(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/9232/headopened View on GitHub

Showing 4 changed files with 43 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
22 additions and 0 deletionsapps/desktop/src/shell/DesktopShellEnvironment.test.tsModified
View file
@@ -439,6 +439,28 @@
}),
​
+ it.effect("appends known CLI directories on macOS when neither probe returns a PATH", () =>
+ Effect.gen(function* () {
+ // No SHELL, and the bare PATH launchd hands a .app, with a caller-chosen
+ // toolchain dir in front that must stay ahead of the fallback dirs.
+ const env: NodeJS.ProcessEnv = {
+ HOME: "/Users/test",
+ PATH: "/Users/test/.nvm/versions/node/v22.0.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
+ };
+​
+ yield* runShellEnvironment({
+ env,
+ platform: "darwin",
+ handler: () => "",
+ });
+​
+ assert.equal(
+ env.PATH,
+ "/Users/test/.nvm/versions/node/v22.0.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/Users/test/.local/bin",
+ );
+ }),
+ );
+​
it.effect("loads PowerShell profile environment on Windows", () =>
Effect.gen(function* () {
const env: NodeJS.ProcessEnv = {