Webchat: resolve static root in packaged app

main
Peter Steinberger 2025-12-08 14:07:10 +00:00
parent cd30a99fae
commit ff3337feed
1 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,14 @@ let state: WebChatServerState | null = null;
function resolveWebRoot() {
const here = path.dirname(fileURLToPath(import.meta.url));
// repo-relative: apps/macos/Sources/Clawdis/Resources/WebChat
// 1) Packaged app: resources live next to the relay bundle at
// Contents/Resources/WebChat. The relay binary runs from
// Contents/Resources/Relay/bun, so walk up one and check.
const packagedRoot = path.resolve(path.dirname(process.execPath), "../WebChat");
if (fs.existsSync(packagedRoot)) return packagedRoot;
// 2) Dev / source checkout: repo-relative path.
return path.resolve(here, "../../apps/macos/Sources/Clawdis/Resources/WebChat");
}