fix(cli): remove silent error swallowing in ensureRealDir

This commit is contained in:
Catriel Müller
2026-05-08 16:49:53 -03:00
parent 53ef0be6b9
commit 7d730e2fb7
+2 -2
View File
@@ -11,10 +11,10 @@ import fs from "fs/promises"
* mkdir: if stat fails the entry is broken and we remove + recreate it.
*/
export async function ensureRealDir(p: string) {
await fs.mkdir(p, { recursive: true }).catch(() => {})
await fs.mkdir(p, { recursive: true })
const ok = await fs.stat(p).then(() => true).catch(() => false)
if (!ok) {
await fs.rm(p, { force: true }).catch(() => {})
await fs.rm(p, { force: true })
await fs.mkdir(p, { recursive: true })
}
}