()
| 391 | * + an `isEmpty()` check so we can surface the bad-path case in the log. |
| 392 | */ |
| 393 | const installDockIcon = () => { |
| 394 | if (process.platform !== "darwin") return; |
| 395 | if (app.isPackaged) return; |
| 396 | if (!app.dock) return; |
| 397 | const iconPath = resolveSourceIconPath(); |
| 398 | if (!existsSync(iconPath)) { |
| 399 | log.warn(`[dock-icon] file missing at ${iconPath}; skipping`); |
| 400 | return; |
| 401 | } |
| 402 | const image = nativeImage.createFromPath(iconPath); |
| 403 | if (image.isEmpty()) { |
| 404 | log.warn(`[dock-icon] failed to decode ${iconPath}; skipping`); |
| 405 | return; |
| 406 | } |
| 407 | app.dock.setIcon(image); |
| 408 | log.info(`[dock-icon] set to ${iconPath} (${image.getSize().width}×${image.getSize().height})`); |
| 409 | }; |
| 410 | |
| 411 | const createWindow = async (conn: SidecarConnection) => { |
| 412 | const windowState = windowStateKeeper({ |
no test coverage detected