refactor(tts): reuse the shared atomic write helper for the audio cache

This commit is contained in:
Chris Scott committed 2026-10-11 00:14:14 -04:00
1 parent 169ee25a8a
commit bda123b6e1
4 files changed
+57 -70

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ export function canonicalPathSync(target: string): string {
}
}
export async function writeFileAtomic(filePath: string, content: string, options: { mode?: number } = {}): Promise<void> {
export async function writeFileAtomic(filePath: string, content: string | Buffer, options: { mode?: number } = {}): Promise<void> {
const dir = path.dirname(filePath)
await mkdirSafe(dir)
const tempPath = path.join(dir, `.${path.basename(filePath)}.ocm-tmp-${process.pid}-${Date.now()}`)