jbilcke-hf's picture
jbilcke-hf HF staff
another step for the Stories Factory (mp4 generation)
46fcec6
raw
history blame
375 Bytes
import { unlink, rm } from "node:fs/promises"
export async function deleteFile(filePath: string, debug?: boolean): Promise<boolean> {
try {
await rm(filePath, { recursive: true, force: true })
// await unlink(filePath)
return true
} catch (err) {
if (debug) {
console.error(`failed to unlink file at ${filePath}: ${err}`)
}
}
return false
}