mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 19:54:57 +00:00
13 lines
262 B
TypeScript
13 lines
262 B
TypeScript
import fs from "node:fs/promises";
|
|
|
|
export async function unlinkIfExists(filePath: string | null | undefined): Promise<void> {
|
|
if (!filePath) {
|
|
return;
|
|
}
|
|
try {
|
|
await fs.unlink(filePath);
|
|
} catch {
|
|
// Best-effort cleanup for temp files.
|
|
}
|
|
}
|