show version & bump
This commit is contained in:
@@ -1071,4 +1071,11 @@ export function registerAppHandlers() {
|
||||
|
||||
return { success: true, message: "Successfully reset everything" };
|
||||
});
|
||||
|
||||
ipcMain.handle("get-app-version", async () => {
|
||||
// Read version from package.json at project root
|
||||
const packageJsonPath = path.resolve(__dirname, "..", "..", "package.json");
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
||||
return { version: packageJson.version };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -617,6 +617,17 @@ export class IpcClient {
|
||||
}
|
||||
// --- End GitHub Repo Management ---
|
||||
|
||||
// Get the main app version
|
||||
public async getAppVersion(): Promise<string> {
|
||||
try {
|
||||
const result = await this.ipcRenderer.invoke("get-app-version");
|
||||
return result.version as string;
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Example methods for listening to events (if needed)
|
||||
// public on(channel: string, func: (...args: any[]) => void): void {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user