mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Expand fs paths with homedir
This commit is contained in:
3 files changed
+29
No files matched your search
Vendored
+5
@@ -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'
|
||||
|
||||
@@ -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'),
|
||||
|
||||
|
||||
Reference in new issue
Block a user