mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
c4e20db074
commit
60af13db0b
@ -16,6 +16,7 @@ import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
|||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import resolvedShellInjectable from "../../../common/user-store/resolved-shell.injectable";
|
import resolvedShellInjectable from "../../../common/user-store/resolved-shell.injectable";
|
||||||
import spawnPtyInjectable from "../spawn-pty.injectable";
|
import spawnPtyInjectable from "../spawn-pty.injectable";
|
||||||
|
import userStoreInjectable from "../../../common/user-store/user-store.injectable";
|
||||||
|
|
||||||
interface InstantiationParameter {
|
interface InstantiationParameter {
|
||||||
websocket: WebSocket;
|
websocket: WebSocket;
|
||||||
@ -39,6 +40,7 @@ const localShellSessionInjectable = getInjectable({
|
|||||||
logger: di.inject(loggerInjectable),
|
logger: di.inject(loggerInjectable),
|
||||||
resolvedShell: di.inject(resolvedShellInjectable),
|
resolvedShell: di.inject(resolvedShellInjectable),
|
||||||
spawnPty: di.inject(spawnPtyInjectable),
|
spawnPty: di.inject(spawnPtyInjectable),
|
||||||
|
userStore: di.inject(userStoreInjectable),
|
||||||
}, {
|
}, {
|
||||||
kubectl: createKubectl(cluster.version),
|
kubectl: createKubectl(cluster.version),
|
||||||
websocket,
|
websocket,
|
||||||
|
|||||||
@ -4,13 +4,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { UserStore } from "../../../common/user-store";
|
import type { UserStore } from "../../../common/user-store";
|
||||||
import type { ClusterId } from "../../../common/cluster-types";
|
import type { ClusterId } from "../../../common/cluster-types";
|
||||||
import type { ShellSessionArgs, ShellSessionDependencies } from "../shell-session";
|
import type { ShellSessionArgs, ShellSessionDependencies } from "../shell-session";
|
||||||
import { ShellSession } from "../shell-session";
|
import { ShellSession } from "../shell-session";
|
||||||
import { baseBinariesDir } from "../../../common/vars";
|
import { baseBinariesDir } from "../../../common/vars";
|
||||||
|
|
||||||
interface LocalShellSessionDependencies extends ShellSessionDependencies {
|
interface LocalShellSessionDependencies extends ShellSessionDependencies {
|
||||||
|
readonly userStore: UserStore;
|
||||||
modifyTerminalShellEnv: (clusterId: ClusterId, env: Record<string, string | undefined>) => Record<string, string | undefined>;
|
modifyTerminalShellEnv: (clusterId: ClusterId, env: Record<string, string | undefined>) => Record<string, string | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,8 +45,8 @@ export class LocalShellSession extends ShellSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async getShellArgs(shell: string): Promise<string[]> {
|
protected async getShellArgs(shell: string): Promise<string[]> {
|
||||||
const pathFromPreferences = UserStore.getInstance().kubectlBinariesPath || this.kubectl.getBundledPath();
|
const pathFromPreferences = this.dependencies.userStore.kubectlBinariesPath || this.kubectl.getBundledPath();
|
||||||
const kubectlPathDir = UserStore.getInstance().downloadKubectlBinaries ? await this.kubectlBinDirP : path.dirname(pathFromPreferences);
|
const kubectlPathDir = this.dependencies.userStore.downloadKubectlBinaries ? await this.kubectlBinDirP : path.dirname(pathFromPreferences);
|
||||||
|
|
||||||
switch(path.basename(shell)) {
|
switch(path.basename(shell)) {
|
||||||
case "powershell.exe":
|
case "powershell.exe":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user