diff --git a/electron/src/fsjob.ts b/electron/src/fsjob.ts index 6672ad8d..0e85ea69 100644 --- a/electron/src/fsjob.ts +++ b/electron/src/fsjob.ts @@ -49,6 +49,10 @@ export class FsJobHandler { } private async write(file: string, contents: string): Promise { + // The target directory might not exist, ensure it does + const parentDir = path.dirname(file); + await fs.mkdir(parentDir, { recursive: true }); + // Backups not implemented yet. await fs.writeFile(file, contents, { encoding: "utf-8",