mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
fix: removing backup folder before uploading
This commit is contained in:
parent
75be6e5b47
commit
9405b0dcfc
2 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,7 @@ const replaceLudusaviBackupWithCurrentUser = (
|
||||||
// Directories are different, rename
|
// Directories are different, rename
|
||||||
if (backupHomeDir !== currentHomeDir) {
|
if (backupHomeDir !== currentHomeDir) {
|
||||||
if (fs.existsSync(newPath)) {
|
if (fs.existsSync(newPath)) {
|
||||||
|
// Ensures that the destination is empty
|
||||||
fs.rmSync(newPath, {
|
fs.rmSync(newPath, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
|
|
|
@ -13,6 +13,11 @@ import { app } from "electron";
|
||||||
const bundleBackup = async (shop: GameShop, objectId: string) => {
|
const bundleBackup = async (shop: GameShop, objectId: string) => {
|
||||||
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
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);
|
await Ludusavi.backupGame(shop, objectId, backupPath);
|
||||||
|
|
||||||
const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`);
|
const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue