mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix completely overriding PATH in shellSync (#5451)
This commit is contained in:
1 parent
592600c1bb
commit
5c11d7f7fe
4 files changed
+56
-2
No files matched your search
@@ -8,6 +8,7 @@ import os from "os";
|
||||
import { app } from "electron";
|
||||
import logger from "./logger";
|
||||
import { isSnap } from "../common/vars";
|
||||
import { unionPATHs } from "../common/utils/union-env-path";
|
||||
|
||||
/**
|
||||
* shellSync loads what would have been the environment if this application was
|
||||
@@ -25,7 +26,8 @@ export async function shellSync() {
|
||||
}
|
||||
|
||||
if (!isSnap) {
|
||||
process.env.PATH = env.PATH;
|
||||
// Prefer the synced PATH over the initial one
|
||||
process.env.PATH = unionPATHs(env.PATH ?? "", process.env.PATH ?? "");
|
||||
}
|
||||
|
||||
// The spread operator allows joining of objects. The precedence is last to first.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import shellEnvironment from "shell-env";
|
||||
import logger from "../logger";
|
||||
|
||||
export type EnvironmentVariables = Record<string, string>;
|
||||
export type EnvironmentVariables = Partial<Record<string, string>>;
|
||||
|
||||
let shellSyncFailed = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user