Skip to content

Commit 789769c

Browse files
authored
fix: can not find file when export (Kong#9636)
1 parent 526b8f9 commit 789769c

File tree

1 file changed

+2
-0
lines changed
  • packages/insomnia/src/main/ipc

1 file changed

+2
-0
lines changed

packages/insomnia/src/main/ipc/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ export function registerMainHandlers() {
232232
});
233233
ipcMainHandle('writeFile', async (_, options: { path: string; content: string }) => {
234234
try {
235+
const dir = path.dirname(options.path);
236+
await fs.promises.mkdir(dir, { recursive: true });
235237
await fs.promises.writeFile(options.path, options.content);
236238
return options.path;
237239
} catch (err) {

0 commit comments

Comments
 (0)