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) {