Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 342 Bytes
2cae2a9 46fcec6 2cae2a9 46fcec6 2cae2a9 |
1 2 3 4 5 6 7 8 9 10 11 12 |
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))
}
}
}
|