Merge branch 'feature/cloud-sync' into feature/game-achievements

This commit is contained in:
Zamitto
2024-10-07 19:13:20 -03:00
6 changed files with 6 additions and 10 deletions

View File

@@ -42,6 +42,7 @@ const replaceLudusaviBackupWithCurrentUser = (
// Directories are different, rename
if (backupHomeDir !== currentHomeDir) {
if (fs.existsSync(newPath)) {
// Ensures that the destination is empty
fs.rmSync(newPath, {
recursive: true,
force: true,

View File

@@ -13,6 +13,11 @@ import { app } from "electron";
const bundleBackup = async (shop: GameShop, objectId: string) => {
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
// Remove existing backup
if (fs.existsSync(backupPath)) {
fs.rmSync(backupPath, { recursive: true });
}
await Ludusavi.backupGame(shop, objectId, backupPath);
const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`);