mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 20:13:43 +00:00
refactor(media): add shared ffmpeg helpers
This commit is contained in:
12
src/media/temp-files.ts
Normal file
12
src/media/temp-files.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user