refactor(main): extract file ops to src/main/files/ (search, git, binary)

This commit is contained in:
2026-06-06 09:43:31 +05:30
parent 356cfc5cc8
commit 2a32e702f3
5 changed files with 247 additions and 195 deletions
+13
View File
@@ -0,0 +1,13 @@
// src/main/files/binary.js
// Binary file write handler (used by Word .docx export)
const { ipcMain } = require('electron');
const fs = require('fs').promises;
function register() {
ipcMain.handle('write-buffer', async (_event, { path: filePath, buffer }) => {
await fs.writeFile(filePath, Buffer.from(buffer));
return { ok: true };
});
}
module.exports = { register };