feat: git initialisation

This commit is contained in:
2026-02-16 10:47:55 +01:00
parent 1ecaae3dbd
commit 3b9ff2fc22
9 changed files with 523 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
import { contextBridge, ipcRenderer } from 'electron';
import type { ElectronAPI } from './shared/electronApi';
import type { GitInitProgress } from './shared/electronApi';
// Expose protected methods that allow the renderer process to use
// ipcRenderer without exposing the entire object
@@ -15,6 +16,11 @@ export const electronAPI: ElectronAPI = {
}
return ipcRenderer.invoke('git:init', projectPath);
},
onInitProgress: (callback: (data: GitInitProgress) => void) => {
const subscription = (_event: Electron.IpcRendererEvent, data: GitInitProgress) => callback(data);
ipcRenderer.on('git:initProgress', subscription);
return () => ipcRenderer.removeListener('git:initProgress', subscription);
},
},
// Projects