(filePath: string, content: string, lockDir: string, detail: string)
| 126 | |
| 127 | /** Write with exclusive create — compromised error if file already exists. */ |
| 128 | const exclusiveWrite = (filePath: string, content: string, lockDir: string, detail: string) => |
| 129 | fs.writeFileString(filePath, content, { flag: "wx" }).pipe( |
| 130 | Effect.catch(() => |
| 131 | Effect.gen(function* () { |
| 132 | yield* forceRemove(lockDir) |
| 133 | return yield* new LockCompromisedError({ detail }) |
| 134 | }), |
| 135 | ), |
| 136 | ) |
| 137 | |
| 138 | const cleanStaleBreaker = Effect.fnUntraced(function* (breakerPath: string) { |
| 139 | const bs = yield* safeStat(breakerPath) |
no test coverage detected