mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: removing existing directory
This commit is contained in:
parent
9391b7e6c9
commit
f6acfa4aee
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user