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

Function installDockIcon

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

Source from the content-addressed store, hash-verified

468 * + an `isEmpty()` check so we can surface the bad-path case in the log.
469 */
470const installDockIcon = () => {
471 if (process.platform !== "darwin") return;
472 if (app.isPackaged) return;
473 if (!app.dock) return;
474 const iconPath = resolveSourceIconPath();
475 if (!existsSync(iconPath)) {
476 log.warn(`[dock-icon] file missing at ${iconPath}; skipping`);
477 return;
478 }
479 const image = nativeImage.createFromPath(iconPath);
480 if (image.isEmpty()) {
481 log.warn(`[dock-icon] failed to decode ${iconPath}; skipping`);
482 return;
483 }
484 app.dock.setIcon(image);
485 log.info(`[dock-icon] set to ${iconPath} (${image.getSize().width}×${image.getSize().height})`);
486};
487
488const createMainBrowserWindow = (options: { readonly show: boolean }): BrowserWindow => {
489 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