From 92454f20a18aa4dcedbd369f5e1eaadfd5fb3479 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 16 Nov 2022 11:53:17 -0500 Subject: [PATCH] Switch legacy execHelm to use legacy global DI for binaryPath Signed-off-by: Sebastian Malton --- src/main/helm/exec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/helm/exec.ts b/src/main/helm/exec.ts index 2847ce6102..6dbaa3f000 100644 --- a/src/main/helm/exec.ts +++ b/src/main/helm/exec.ts @@ -6,9 +6,10 @@ import { promiseExecFile } from "../../common/utils/promise-exec"; import type { ObjectEncodingOptions } from "fs"; import type { ExecFileOptions, ExecFileOptionsWithStringEncoding } from "child_process"; -import { helmBinaryPath } from "../../common/vars"; import { UserStore } from "../../common/user-store"; import { isChildProcessError } from "../../common/utils"; +import { getLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; +import helmBinaryPathInjectable from "./helm-binary-path.injectable"; /** * ExecFile the bundled helm CLI @@ -19,6 +20,8 @@ export async function execHelm(args: string[], { encoding, ...rest }: ObjectEnco encoding: encoding ?? "utf-8", ...rest, }; + const di = getLegacyGlobalDiForExtensionApi(); + const helmBinaryPath = di.inject(helmBinaryPathInjectable); try { const opts = { ...options }; @@ -29,7 +32,7 @@ export async function execHelm(args: string[], { encoding, ...rest }: ObjectEnco opts.env.HTTPS_PROXY = UserStore.getInstance().httpsProxy; } - const { stdout } = await promiseExecFile(helmBinaryPath.get(), args, opts); + const { stdout } = await promiseExecFile(helmBinaryPath, args, opts); return stdout; } catch (error) {