diff --git a/extensions/license/main.ts b/extensions/license/main.ts index 63451e9f82..d43cf09e96 100644 --- a/extensions/license/main.ts +++ b/extensions/license/main.ts @@ -1,5 +1,4 @@ -import { LensMainExtension } from "@k8slens/extensions"; -import { shell } from "electron"; +import { LensMainExtension, Util } from "@k8slens/extensions"; export default class LicenseLensMainExtension extends LensMainExtension { appMenus = [ @@ -7,7 +6,7 @@ export default class LicenseLensMainExtension extends LensMainExtension { parentId: "help", label: "License", async click() { - shell.openExternal("https://k8slens.dev/licenses/eula.md"); + Util.openExternal("https://k8slens.dev/licenses/eula.md") } } ] diff --git a/src/common/utils/index.ts b/src/common/utils/index.ts index db46a37d97..0dfad2d15f 100644 --- a/src/common/utils/index.ts +++ b/src/common/utils/index.ts @@ -11,4 +11,4 @@ export * from "./getRandId" export * from "./splitArray" export * from "./saveToAppFiles" export * from "./singleton" -export * from "./cloneJson" +export * from "./openExternal" diff --git a/src/common/utils/openExternal.ts b/src/common/utils/openExternal.ts new file mode 100644 index 0000000000..02c4da6c3b --- /dev/null +++ b/src/common/utils/openExternal.ts @@ -0,0 +1,6 @@ +// Opens a link in external browser +import { shell } from "electron" + +export function openExternal(url: string) { + return shell.openExternal(url); +} diff --git a/src/extensions/core-api/utils.ts b/src/extensions/core-api/utils.ts index 629d15e42e..c70959f2ba 100644 --- a/src/extensions/core-api/utils.ts +++ b/src/extensions/core-api/utils.ts @@ -1,3 +1,3 @@ -export { Singleton } from "../../common/utils" +export { Singleton, openExternal } from "../../common/utils" export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault" export { cssNames } from "../../renderer/utils/cssNames"