mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
refactor(tts): reuse the shared atomic write helper for the audio cache
This commit is contained in:
1 parent
169ee25a8a
commit
bda123b6e1
4 files changed
+57
-70
No files matched your search
@@ -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()}`)
|
||||
|
||||
Reference in new issue
Block a user