Expand fs paths with homedir

This commit is contained in:
Alex Gleason committed 2025-10-30 18:05:03 -05:00
1 parent 1bd21f2625
commit b0c0b5c9a4
3 files changed
+29

No files matched your search

+5
View File
@@ -60,6 +60,11 @@ interface ElectronShellAPI {
}
interface ElectronAPI {
/**
* Get the user's home directory path.
*/
homedir: string;
/**
* Get the current platform.
* @returns 'darwin' | 'win32' | 'linux'
+4
View File
@@ -1,8 +1,12 @@
import { contextBridge, ipcRenderer } from 'electron';
import os from 'node:os';
// Expose protected methods that allow the renderer process to use
// ipcRenderer without exposing the entire object
contextBridge.exposeInMainWorld('electron', {
// Get the home directory
homedir: os.homedir(),
// Platform information
platform: () => ipcRenderer.invoke('get-platform'),