We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04bdf77 commit 656f299Copy full SHA for 656f299
1 file changed
packages/core/src/fs-util.ts
@@ -114,7 +114,14 @@ export namespace FSUtil {
114
})
115
116
const ensureDir = Effect.fn("FileSystem.ensureDir")(function* (path: string) {
117
- yield* fs.makeDirectory(path, { recursive: true })
+ yield* fs.makeDirectory(path, { recursive: true }).pipe(
118
+ // Bun on Windows can throw EEXIST here despite recursive mode.
119
+ // https://github.com/oven-sh/bun/issues/21901
120
+ Effect.catchIf(
121
+ (error) => error.reason._tag === "AlreadyExists",
122
+ (error) => isDir(path).pipe(Effect.flatMap((exists) => (exists ? Effect.void : Effect.fail(error)))),
123
+ ),
124
+ )
125
126
127
const writeWithDirs = Effect.fn("FileSystem.writeWithDirs")(function* (
0 commit comments