-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreload.js
More file actions
15 lines (14 loc) · 868 Bytes
/
Copy pathpreload.js
File metadata and controls
15 lines (14 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('api', {
getConfig: () => ipcRenderer.invoke('get-config'),
saveConfig: (config) => ipcRenderer.invoke('save-config', config),
pickRepoFolder: () => ipcRenderer.invoke('pick-repo-folder'),
scanFolder: () => ipcRenderer.invoke('scan-folder'),
repoStatus: (localPath) => ipcRenderer.invoke('repo-status', localPath),
repoBranches: (localPath) => ipcRenderer.invoke('repo-branches', localPath),
syncRepo: (localPath, branch) => ipcRenderer.invoke('sync-repo', localPath, branch),
exportWorkspace: (data) => ipcRenderer.invoke('export-workspace', data),
importWorkspace: () => ipcRenderer.invoke('import-workspace'),
checkGit: () => ipcRenderer.invoke('check-git'),
onGitLog: (callback) => ipcRenderer.on('git-log', (_event, entry) => callback(entry)),
});