lila/data-pipeline/utils/delete-file.ts
2026-07-06 13:09:30 +02:00

10 lines
223 B
TypeScript

import fs from "fs";
/**
* Deletes a file if it exists. Silently ignores missing files.
*/
export function deleteFileIfExists(filePath: string): void {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
}
}