mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Switch legacy execHelm to use legacy global DI for binaryPath
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
1aef332a7c
commit
92454f20a1
@ -6,9 +6,10 @@
|
|||||||
import { promiseExecFile } from "../../common/utils/promise-exec";
|
import { promiseExecFile } from "../../common/utils/promise-exec";
|
||||||
import type { ObjectEncodingOptions } from "fs";
|
import type { ObjectEncodingOptions } from "fs";
|
||||||
import type { ExecFileOptions, ExecFileOptionsWithStringEncoding } from "child_process";
|
import type { ExecFileOptions, ExecFileOptionsWithStringEncoding } from "child_process";
|
||||||
import { helmBinaryPath } from "../../common/vars";
|
|
||||||
import { UserStore } from "../../common/user-store";
|
import { UserStore } from "../../common/user-store";
|
||||||
import { isChildProcessError } from "../../common/utils";
|
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
|
* ExecFile the bundled helm CLI
|
||||||
@ -19,6 +20,8 @@ export async function execHelm(args: string[], { encoding, ...rest }: ObjectEnco
|
|||||||
encoding: encoding ?? "utf-8",
|
encoding: encoding ?? "utf-8",
|
||||||
...rest,
|
...rest,
|
||||||
};
|
};
|
||||||
|
const di = getLegacyGlobalDiForExtensionApi();
|
||||||
|
const helmBinaryPath = di.inject(helmBinaryPathInjectable);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const opts = { ...options };
|
const opts = { ...options };
|
||||||
@ -29,7 +32,7 @@ export async function execHelm(args: string[], { encoding, ...rest }: ObjectEnco
|
|||||||
opts.env.HTTPS_PROXY = UserStore.getInstance().httpsProxy;
|
opts.env.HTTPS_PROXY = UserStore.getInstance().httpsProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { stdout } = await promiseExecFile(helmBinaryPath.get(), args, opts);
|
const { stdout } = await promiseExecFile(helmBinaryPath, args, opts);
|
||||||
|
|
||||||
return stdout;
|
return stdout;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user