Update src/backend/utils/database-file-encryption.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Luke Gustafson
2025-11-05 21:19:33 -06:00
committed by GitHub
parent bb6214ca85
commit 090cc3f924

View File

@@ -62,14 +62,7 @@ class DatabaseFileEncryption {
fs.writeFileSync(tmpPath, encrypted);
fs.writeFileSync(tmpMetadataPath, JSON.stringify(metadata, null, 2));
if (fs.existsSync(targetPath)) {
fs.unlinkSync(targetPath);
}
fs.renameSync(tmpPath, targetPath);
if (fs.existsSync(metadataPath)) {
fs.unlinkSync(metadataPath);
}
fs.renameSync(tmpMetadataPath, metadataPath);
return targetPath;