Init commit

This commit is contained in:
ShreejitPanchal
2026-05-19 19:56:02 +08:00
commit 6601501eff
4047 changed files with 2185372 additions and 0 deletions

12
server/core/helpers/fs.ts Normal file
View File

@@ -0,0 +1,12 @@
import { move } from 'fs-extra/esm'
import { rename } from 'fs/promises'
export async function tryAtomicMove (src: string, destination: string) {
try {
await rename(src, destination)
} catch (err) {
if (err?.code !== 'EXDEV') throw err
return move(src, destination, { overwrite: true })
}
}