refactoring

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-11 11:32:29 +03:00
1 parent 8bb3954700
commit e72e28ddab
22 files changed
+133 -218

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
// Clone json-serializable object
export function cloneJsonObject<T = object>(obj: T): T {
return JSON.parse(JSON.stringify(obj));
}
+1
View File
@@ -4,3 +4,4 @@ export * from "./base64"
export * from "./camelCase"
export * from "./splitArray"
export * from "./randomFileName"
export * from "./cloneJson"
+1 -4
View File
@@ -2,11 +2,8 @@ import { app, remote } from "electron"
import { ensureDirSync, writeFileSync } from "fs-extra"
import * as path from "path"
// todo: move to main/kubeconfig-manager.ts (?)
// Writes kubeconfigs to "embedded" store, i.e. .../Lens/kubeconfigs/
// Write kubeconfigs to "embedded" store, i.e. "/Users/ixrock/Library/Application Support/Lens/kubeconfigs"
export function writeEmbeddedKubeConfig(clusterId: string, kubeConfig: string): string {
// This can be called from main & renderer
const userData = (app || remote.app).getPath("userData");
const kubeConfigBase = path.join(userData, "kubeconfigs")
ensureDirSync(kubeConfigBase)