mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
change internal hostname to app, revert spacing
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
2ee1d3d794
commit
f97002828f
@ -26,7 +26,6 @@ import { InstalledExtension, extensionDiscovery } from "../extensions/extension-
|
|||||||
import type { LensExtensionId } from "../extensions/lens-extension";
|
import type { LensExtensionId } from "../extensions/lens-extension";
|
||||||
import { installDeveloperTools } from "./developer-tools";
|
import { installDeveloperTools } from "./developer-tools";
|
||||||
import { filesystemProvisionerStore } from "./extension-filesystem";
|
import { filesystemProvisionerStore } from "./extension-filesystem";
|
||||||
import { bindBroadcastHandlers } from "../common/ipc";
|
|
||||||
import { LensProtocolRouterMain } from "./protocol-handler";
|
import { LensProtocolRouterMain } from "./protocol-handler";
|
||||||
|
|
||||||
const workingDir = path.join(app.getPath("appData"), appName);
|
const workingDir = path.join(app.getPath("appData"), appName);
|
||||||
@ -56,16 +55,14 @@ if (!app.requestSingleInstanceLock()) {
|
|||||||
app.exit();
|
app.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
app
|
app.on("second-instance", () => {
|
||||||
.on("second-instance", () => {
|
|
||||||
windowManager?.ensureMainWindow();
|
windowManager?.ensureMainWindow();
|
||||||
})
|
});
|
||||||
.on("ready", async () => {
|
|
||||||
|
app.on("ready", async () => {
|
||||||
logger.info(`🚀 Starting Lens from "${workingDir}"`);
|
logger.info(`🚀 Starting Lens from "${workingDir}"`);
|
||||||
await shellSync();
|
await shellSync();
|
||||||
|
|
||||||
bindBroadcastHandlers();
|
|
||||||
|
|
||||||
powerMonitor.on("shutdown", () => {
|
powerMonitor.on("shutdown", () => {
|
||||||
app.exit();
|
app.exit();
|
||||||
});
|
});
|
||||||
@ -138,15 +135,17 @@ app
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
appEventBus.emit({ name: "service", action: "start" });
|
appEventBus.emit({ name: "service", action: "start" });
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
});
|
||||||
.on("activate", (event, hasVisibleWindows) => {
|
|
||||||
|
app.on("activate", (event, hasVisibleWindows) => {
|
||||||
logger.info("APP:ACTIVATE", { hasVisibleWindows });
|
logger.info("APP:ACTIVATE", { hasVisibleWindows });
|
||||||
|
|
||||||
if (!hasVisibleWindows) {
|
if (!hasVisibleWindows) {
|
||||||
windowManager?.initMainWindow(false);
|
windowManager?.initMainWindow(false);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.on("will-quit", (event) => {
|
|
||||||
|
app.on("will-quit", (event) => {
|
||||||
// Quit app on Cmd+Q (MacOS)
|
// Quit app on Cmd+Q (MacOS)
|
||||||
logger.info("APP:QUIT");
|
logger.info("APP:QUIT");
|
||||||
appEventBus.emit({name: "app", action: "close"});
|
appEventBus.emit({name: "app", action: "close"});
|
||||||
@ -154,8 +153,9 @@ app
|
|||||||
clusterManager?.stop(); // close cluster connections
|
clusterManager?.stop(); // close cluster connections
|
||||||
|
|
||||||
return; // skip exit to make tray work, to quit go to app's global menu or tray's menu
|
return; // skip exit to make tray work, to quit go to app's global menu or tray's menu
|
||||||
})
|
});
|
||||||
.on("open-url", (event, rawUrl) => {
|
|
||||||
|
app.on("open-url", (event, rawUrl) => {
|
||||||
// lens:// protocol handler
|
// lens:// protocol handler
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ app
|
|||||||
.getInstance<LensProtocolRouterMain>()
|
.getInstance<LensProtocolRouterMain>()
|
||||||
.route(rawUrl)
|
.route(rawUrl)
|
||||||
.catch(error => logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl }));
|
.catch(error => logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl }));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Extensions-api runtime exports
|
// Extensions-api runtime exports
|
||||||
export const LensExtensionsApi = {
|
export const LensExtensionsApi = {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
|
|||||||
logger.info(`${proto.LensProtocolRouter.LoggingPrefix}: routing ${url.toString()}`);
|
logger.info(`${proto.LensProtocolRouter.LoggingPrefix}: routing ${url.toString()}`);
|
||||||
|
|
||||||
switch (url.host) {
|
switch (url.host) {
|
||||||
case "internal":
|
case "app":
|
||||||
return this._routeToInternal(url);
|
return this._routeToInternal(url);
|
||||||
case "extension":
|
case "extension":
|
||||||
return this._routeToExtension(url);
|
return this._routeToExtension(url);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user