mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 10:02:04 +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.
|
|
}
|
|
}
|