Skip to content

Commit 92ce49d

Browse files
committed
Use Electron's app.getVersion() for better performance
Replaced manual file reading with Electron's built-in app.getVersion() method which is more efficient and reliable.
1 parent a529b6e commit 92ce49d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

main.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,15 +606,9 @@ ipcMain.handle("save-terminal-settings", (_event, settings: any) => {
606606
(store as any).set("terminalSettings", settings);
607607
});
608608

609-
// Get app version from package.json
609+
// Get app version
610610
ipcMain.handle("get-app-version", () => {
611-
try {
612-
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json"), "utf8"));
613-
return packageJson.version;
614-
} catch (error) {
615-
console.error("Error reading version:", error);
616-
return "unknown";
617-
}
611+
return app.getVersion();
618612
});
619613

620614
// MCP Server management functions

0 commit comments

Comments
 (0)