Skip to content
Source
Sign inSign up
pingdotgg/t3code

Improve shell PATH hydration and fallback detection #1799

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/1799/headmerged by juliusmarminge View on GitHub

Showing 6 changed files with 159 additions and 17 deletions (loading 3).

x
0 of 6 viewed, 6 left
70 additions and 4 deletionsapps/desktop/src/syncShellEnvironment.test.tsModified
View file
@@ -6,11 +6,12 @@
it("hydrates PATH and missing SSH_AUTH_SOCK from the login shell on macOS", () => {
const env: NodeJS.ProcessEnv = {
SHELL: "/bin/zsh",
- PATH: "/usr/bin",
+ PATH: "/Users/test/.local/bin:/usr/bin",
};
const readEnvironment = vi.fn(() => ({
PATH: "/opt/homebrew/bin:/usr/bin",
SSH_AUTH_SOCK: "/tmp/secretive.sock",
+ HOMEBREW_PREFIX: "/opt/homebrew",
}));
​
syncShellEnvironment(env, {
@@ -18,9 +19,18 @@
readEnvironment,
});
​
- expect(readEnvironment).toHaveBeenCalledWith("/bin/zsh", ["PATH", "SSH_AUTH_SOCK"]);
- expect(env.PATH).toBe("/opt/homebrew/bin:/usr/bin");
+ expect(readEnvironment).toHaveBeenCalledWith("/bin/zsh", [
+ "PATH",
+ "SSH_AUTH_SOCK",
+ "HOMEBREW_PREFIX",
+ "HOMEBREW_CELLAR",
+ "HOMEBREW_REPOSITORY",
+ "XDG_CONFIG_HOME",
+ "XDG_DATA_HOME",
+ ]);