Make download dir option consistent with other settings (#875)

* make download dir option consitent with other settings

* make path to kubectl setting consistent

Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
Signed-off-by: Sebastian Malton <sebastian@malton.name>

Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
authored and GitHub committed 2020-09-23 08:57:51 -04:00
1 parent 2f53e76060
commit b88c0d4fbf
3 files changed
+28 -36

No files matched your search

+7 -3
View File
@@ -36,7 +36,7 @@ const packageMirrors: Map<string, string> = new Map([
let bundledPath: string
const initScriptVersionString = "# lens-initscript v3\n"
if (isDevelopment || isTestEnv) {
if (isDevelopment || isTestEnv) {
const platformName = isWindows ? "windows" : process.platform
bundledPath = path.join(process.cwd(), "binaries", "client", platformName, process.arch, "kubectl")
} else {
@@ -110,7 +110,11 @@ export class Kubectl {
}
protected getDownloadDir() {
return userStore.preferences?.downloadBinariesPath || Kubectl.kubectlDir
if (userStore.preferences?.downloadBinariesPath) {
return path.join(userStore.preferences.downloadBinariesPath, "kubectl")
}
return Kubectl.kubectlDir
}
public async getPath(bundled = false): Promise<string> {
@@ -214,7 +218,7 @@ export class Kubectl {
});
isValid = !await this.checkBinary(this.path, false)
}
if(!isValid) {
if (!isValid) {
logger.debug(`Releasing lock for ${this.kubectlVersion}`)
release()
return false