feat: removing existing directory

This commit is contained in:
Chubby Granny Chaser 2024-10-05 04:53:15 +01:00
parent 9391b7e6c9
commit f6acfa4aee
No known key found for this signature in database

View File

@ -36,11 +36,6 @@ const replaceLudusaviBackupWithCurrentUser = (
// TODO: Only works on Windows
const usersDirPath = path.join(gameBackupPath, "drive-C", "Users");
fs.rmSync(gameBackupPath, {
recursive: true,
force: true,
});
fs.renameSync(
path.join(usersDirPath, path.basename(backupHomeDir)),
path.join(usersDirPath, path.basename(currentHomeDir))
@ -78,6 +73,13 @@ const downloadGameArtifact = async (
const zipLocation = path.join(app.getPath("userData"), objectKey);
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
if (fs.existsSync(backupPath)) {
fs.rmSync(backupPath, {
recursive: true,
force: true,
});
}
const response = await axios.get(downloadUrl, {
responseType: "stream",
onDownloadProgress: (progressEvent) => {