mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
3 files changed
+28
-36
No files matched your search
+7
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user