MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / installDockIcon

Function installDockIcon

apps/desktop/src/main/index.ts:463–479  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461 * + an `isEmpty()` check so we can surface the bad-path case in the log.
462 */
463const installDockIcon = () => {
464 if (process.platform !== "darwin") return;
465 if (app.isPackaged) return;
466 if (!app.dock) return;
467 const iconPath = resolveSourceIconPath();
468 if (!existsSync(iconPath)) {
469 log.warn(`[dock-icon] file missing at ${iconPath}; skipping`);
470 return;
471 }
472 const image = nativeImage.createFromPath(iconPath);
473 if (image.isEmpty()) {
474 log.warn(`[dock-icon] failed to decode ${iconPath}; skipping`);
475 return;
476 }
477 app.dock.setIcon(image);
478 log.info(`[dock-icon] set to ${iconPath} (${image.getSize().width}×${image.getSize().height})`);
479};
480
481const createMainBrowserWindow = (options: { readonly show: boolean }): BrowserWindow => {
482 const windowState = windowStateKeeper({

Callers 1

bootFunction · 0.85

Calls 3

resolveSourceIconPathFunction · 0.85
warnMethod · 0.80
infoMethod · 0.65

Tested by

no test coverage detected