From 0299537736acdcd1ed1828acdbe860c5b5b7ec24 Mon Sep 17 00:00:00 2001 From: dyarkovoy Date: Tue, 12 Dec 2023 03:30:26 +0200 Subject: [PATCH] Fix for issue #1092 (VSC-1257) (#1093) * Fix for issue #1092 * Fix for issue #1092 --- src/idfToolsManager.ts | 5 +++-- src/utils.ts | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/idfToolsManager.ts b/src/idfToolsManager.ts index ef23f914b..9cf19f3d0 100644 --- a/src/idfToolsManager.ts +++ b/src/idfToolsManager.ts @@ -204,8 +204,9 @@ export class IdfToolsManager { pathsToVerify: string, logToChannel: boolean = true ) { - const pathNameInEnv: string = - process.platform === "win32" ? "Path" : "PATH"; + const pathNameInEnv: string = Object.keys(process.env).find( + (k) => k.toUpperCase() == "PATH" + ); let modifiedPath = process.env[pathNameInEnv]; if ( process.env[pathNameInEnv] && diff --git a/src/utils.ts b/src/utils.ts index b2a916b6e..d9daac127 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -978,12 +978,9 @@ export function appendIdfAndToolsToPath(curWorkspace: vscode.Uri) { "partition_table" )}`; - let pathNameInEnv: string; - if (process.platform === "win32") { - pathNameInEnv = "Path"; - } else { - pathNameInEnv = "PATH"; - } + let pathNameInEnv: string = Object.keys(process.env).find( + (k) => k.toUpperCase() == "PATH" + ); if (pathToGitDir) { modifiedEnv[pathNameInEnv] = pathToGitDir + path.delimiter + modifiedEnv[pathNameInEnv];