Files
2026-07-13 13:08:41 +08:00

15 lines
403 B
TypeScript

import { ipcMain } from "electron";
import { readReadableLocalFile } from "../utils/readable-file-access";
export function setupReadFile() {
ipcMain.handle("read-file", async (_, filePath: unknown) => {
try {
const content = readReadableLocalFile(filePath);
return { content };
} catch (error) {
console.error("Error reading file:", error);
throw error;
}
});
}