From ace736c7c214cfd831fd389e5e999a3df9e16234 Mon Sep 17 00:00:00 2001 From: Cody Seibert Date: Sat, 20 Dec 2025 02:08:13 -0500 Subject: [PATCH] Update README and enhance Electron app initialization - Update the link in the README for the Agentic Jumpstart course to include a GitHub-specific query parameter. - Ensure consistent userData path across development and production environments in the Electron app, with error handling for path setting. - Improve the isElectron function to check for Electron context more robustly. --- README.md | 2 +- apps/ui/src/lib/electron.ts | 10 +++++++++- apps/ui/src/main.ts | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39c31d4b..b65ccd63 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ > > Automaker itself was built by a group of engineers using AI and agentic coding techniques to build features faster than ever. By leveraging tools like Cursor IDE and Claude Code CLI, the team orchestrated AI agents to implement complex functionality in days instead of weeks. > -> **Learn how:** Master these same techniques and workflows in the [Agentic Jumpstart course](https://agenticjumpstart.com/?utm=automaker). +> **Learn how:** Master these same techniques and workflows in the [Agentic Jumpstart course](https://agenticjumpstart.com/?utm=automaker-gh). # Automaker diff --git a/apps/ui/src/lib/electron.ts b/apps/ui/src/lib/electron.ts index 83ba64f3..0c170d39 100644 --- a/apps/ui/src/lib/electron.ts +++ b/apps/ui/src/lib/electron.ts @@ -508,7 +508,15 @@ const mockFileSystem: Record = {}; // Check if we're in Electron (for UI indicators only) export const isElectron = (): boolean => { - return typeof window !== "undefined" && window.isElectron === true; + if (typeof window === "undefined") { + return false; + } + + if ((window as any).isElectron === true) { + return true; + } + + return window.electronAPI?.isElectron === true; }; // Check if backend server is available diff --git a/apps/ui/src/main.ts b/apps/ui/src/main.ts index 4d84ffb7..f2157806 100644 --- a/apps/ui/src/main.ts +++ b/apps/ui/src/main.ts @@ -304,6 +304,20 @@ function createWindow(): void { // App lifecycle app.whenReady().then(async () => { + // Ensure userData path is consistent across dev/prod so files land in Automaker dir + try { + const desiredUserDataPath = path.join(app.getPath("appData"), "Automaker"); + if (app.getPath("userData") !== desiredUserDataPath) { + app.setPath("userData", desiredUserDataPath); + console.log("[Electron] userData path set to:", desiredUserDataPath); + } + } catch (error) { + console.warn( + "[Electron] Failed to set userData path:", + (error as Error).message + ); + } + if (process.platform === "darwin" && app.dock) { const iconPath = getIconPath(); if (iconPath) {