Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/bootstrap.ts')
| -rw-r--r-- | editors/code/src/bootstrap.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/src/bootstrap.ts b/editors/code/src/bootstrap.ts index c63c6f2f7c..bddf195803 100644 --- a/editors/code/src/bootstrap.ts +++ b/editors/code/src/bootstrap.ts @@ -187,8 +187,16 @@ async function hasToolchainFileWithRaDeclared(uri: vscode.Uri): Promise<boolean> export async function isValidExecutable(path: string, extraEnv: Env): Promise<boolean> { log.debug("Checking availability of a binary at", path); + const newEnv = { ...process.env }; + for (const [k, v] of Object.entries(extraEnv)) { + if (v) { + newEnv[k] = v; + } else if (k in newEnv) { + delete newEnv[k]; + } + } const res = await spawnAsync(path, ["--version"], { - env: { ...process.env, ...extraEnv }, + env: newEnv, }); if (res.error) { |