From c99954e81f615720883e4d2120509f665f361596 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 29 Oct 2021 16:13:30 -0400 Subject: [PATCH] Don't override PATH under snap Signed-off-by: Sebastian Malton --- src/main/shell-sync.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/shell-sync.ts b/src/main/shell-sync.ts index f9a897b3f9..bb2352e51d 100644 --- a/src/main/shell-sync.ts +++ b/src/main/shell-sync.ts @@ -23,6 +23,7 @@ import { shellEnv } from "./utils/shell-env"; import os from "os"; import { app } from "electron"; import logger from "./logger"; +import { isSnap } from "../common/vars"; /** * shellSync loads what would have been the environment if this application was @@ -39,11 +40,14 @@ export async function shellSync() { env.LANG += ".UTF-8"; } + if (!isSnap) { + process.env.PATH = env.PATH; + } + // The spread operator allows joining of objects. The precedence is last to first. process.env = { ...env, ...process.env, - PATH: env.PATH, }; logger.debug(`[SHELL-SYNC]: Synced shell env, and updating`, env, process.env);