mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
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.
This commit is contained in:
@@ -508,7 +508,15 @@ const mockFileSystem: Record<string, string> = {};
|
||||
|
||||
// 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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user