1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Don't override PATH under snap

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-10-29 16:13:30 -04:00
parent 7ce0cf436a
commit c99954e81f

View File

@ -23,6 +23,7 @@ import { shellEnv } from "./utils/shell-env";
import os from "os"; import os from "os";
import { app } from "electron"; import { app } from "electron";
import logger from "./logger"; import logger from "./logger";
import { isSnap } from "../common/vars";
/** /**
* shellSync loads what would have been the environment if this application was * shellSync loads what would have been the environment if this application was
@ -39,11 +40,14 @@ export async function shellSync() {
env.LANG += ".UTF-8"; env.LANG += ".UTF-8";
} }
if (!isSnap) {
process.env.PATH = env.PATH;
}
// The spread operator allows joining of objects. The precedence is last to first. // The spread operator allows joining of objects. The precedence is last to first.
process.env = { process.env = {
...env, ...env,
...process.env, ...process.env,
PATH: env.PATH,
}; };
logger.debug(`[SHELL-SYNC]: Synced shell env, and updating`, env, process.env); logger.debug(`[SHELL-SYNC]: Synced shell env, and updating`, env, process.env);