Skip to content

Commit 510ec71

Browse files
committed
fix: add missing recursive when creating a path
1 parent afc1d32 commit 510ec71

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class File<T = unknown> extends DataBuddyUtils implements FileInterface<T
3939
if (await this.read({ path, filename })) {
4040
throw new Error(`File ${filename} already exists in ${workingPath}`)
4141
}
42+
await fs.mkdir(workingPath, { recursive: true })
4243
await fs.writeFile(`${workingPath}/${filename}.json`, JSON.stringify(sanitizedData, null, 4))
4344
return this.read({ path, filename })
4445
}

0 commit comments

Comments
 (0)