ai-tube-clap-exporter / src /core /files /deleteFileWithName.mts
jbilcke-hf's picture
jbilcke-hf HF staff
another step for the Stories Factory (mp4 generation)
46fcec6
raw
history blame
342 Bytes
import { promises as fs } from "node:fs"
import path from "node:path"
import { deleteFile } from "./deleteFile.mts"
export const deleteFilesWithName = async (dir: string, name: string, debug?: boolean) => {
for (const file of await fs.readdir(dir)) {
if (file.includes(name)) {
await deleteFile(path.join(dir, file))
}
}
}