From 1242b9119ac26de69ac8e03b490b2b8376a177ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Pen=CC=83alba?= Date: Fri, 10 Jul 2026 13:28:44 +0200 Subject: [PATCH] Separate dev and release userData paths --- src/main/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/index.ts b/src/main/index.ts index 1e02153..7ae6fa2 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -25,6 +25,18 @@ import { WindowManager } from './windows' const isDev = !app.isPackaged +// A dev run (`bun run dev`) and an installed release share GitGrove's identity, +// so they'd land on the same userData dir — and thus the same single-instance +// lock below (Chromium keeps that lock file inside userData). That made the two +// mutually exclusive: launching dev while the release was open (or vice versa) +// just routed argv into the running instance and quit silently. Give the dev +// build its own userData dir so its lock and state stand alone: release + dev +// now run side by side, and dev never clobbers your real recents/session. +// Must run before requestSingleInstanceLock and before app 'ready'. +if (isDev) { + app.setPath('userData', `${app.getPath('userData')} (dev)`) +} + // One process, many windows. A second launch (double-clicking the app again, // `gitgrove --repo ` from a shell) must join the running instance: two // processes would race each other on the recents store, the window-state file