Merge remote-tracking branch 'origin/master' into mobx-6.2

# Conflicts:
#	src/common/user-store.ts
#	src/renderer/components/hotbar/hotbar-icon.tsx
This commit is contained in:
Roman committed 2021-04-28 14:28:37 +03:00
commit 170412a2c4
28 files changed
+357 -138

No files matched your search

+7 -7
View File
@@ -113,12 +113,12 @@ export class Kubectl {
}
public getPathFromPreferences() {
return UserStore.getInstance().preferences?.kubectlBinariesPath || this.getBundledPath();
return UserStore.getInstance().kubectlBinariesPath || this.getBundledPath();
}
protected getDownloadDir() {
if (UserStore.getInstance().preferences?.downloadBinariesPath) {
return path.join(UserStore.getInstance().preferences.downloadBinariesPath, "kubectl");
if (UserStore.getInstance().downloadBinariesPath) {
return path.join(UserStore.getInstance().downloadBinariesPath, "kubectl");
}
return Kubectl.kubectlDir;
@@ -129,7 +129,7 @@ export class Kubectl {
return this.getBundledPath();
}
if (UserStore.getInstance().preferences?.downloadKubectlBinaries === false) {
if (UserStore.getInstance().downloadKubectlBinaries === false) {
return this.getPathFromPreferences();
}
@@ -223,7 +223,7 @@ export class Kubectl {
}
public async ensureKubectl(): Promise<boolean> {
if (UserStore.getInstance().preferences?.downloadKubectlBinaries === false) {
if (UserStore.getInstance().downloadKubectlBinaries === false) {
return true;
}
@@ -303,7 +303,7 @@ export class Kubectl {
}
protected async writeInitScripts() {
const kubectlPath = UserStore.getInstance().preferences?.downloadKubectlBinaries ? this.dirname : path.dirname(this.getPathFromPreferences());
const kubectlPath = UserStore.getInstance().downloadKubectlBinaries ? this.dirname : path.dirname(this.getPathFromPreferences());
const helmPath = helmCli.getBinaryDir();
const fsPromises = fs.promises;
const bashScriptPath = path.join(this.dirname, ".bash_set_path");
@@ -361,7 +361,7 @@ export class Kubectl {
}
protected getDownloadMirror() {
const mirror = packageMirrors.get(UserStore.getInstance().preferences?.downloadMirror);
const mirror = packageMirrors.get(UserStore.getInstance().downloadMirror);
if (mirror) {
return mirror;
@@ -21,8 +21,8 @@ export class LocalShellSession extends ShellSession {
protected async getShellArgs(shell: string): Promise<string[]> {
const helmpath = helmCli.getBinaryDir();
const pathFromPreferences = UserStore.getInstance().preferences.kubectlBinariesPath || this.kubectl.getBundledPath();
const kubectlPathDir = UserStore.getInstance().preferences.downloadKubectlBinaries ? await this.kubectlBinDirP : path.dirname(pathFromPreferences);
const pathFromPreferences = UserStore.getInstance().kubectlBinariesPath || this.kubectl.getBundledPath();
const kubectlPathDir = UserStore.getInstance().downloadKubectlBinaries ? await this.kubectlBinDirP : path.dirname(pathFromPreferences);
switch(path.basename(shell)) {
case "powershell.exe":
+2 -2
View File
@@ -119,7 +119,7 @@ export abstract class ShellSession {
protected async getShellEnv() {
const env = clearKubeconfigEnvVars(JSON.parse(JSON.stringify(await shellEnv())));
const pathStr = [...this.getPathEntries(), await this.kubectlBinDirP, process.env.PATH].join(path.delimiter);
const shell = UserStore.getInstance().preferences.shell || process.env.SHELL || process.env.PTYSHELL;
const shell = UserStore.getInstance().resolvedShell;
delete env.DEBUG; // don't pass DEBUG into shells
@@ -143,7 +143,7 @@ export abstract class ShellSession {
if (path.basename(env.PTYSHELL) === "zsh") {
env.OLD_ZDOTDIR = env.ZDOTDIR || env.HOME;
env.ZDOTDIR = this.kubectlBinDirP;
env.ZDOTDIR = await this.kubectlBinDirP;
env.DISABLE_AUTO_UPDATE = "true";
}