mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +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
|
// TODO: Only works on Windows
|
||||||
const usersDirPath = path.join(gameBackupPath, "drive-C", "Users");
|
const usersDirPath = path.join(gameBackupPath, "drive-C", "Users");
|
||||||
|
|
||||||
fs.rmSync(gameBackupPath, {
|
|
||||||
recursive: true,
|
|
||||||
force: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
fs.renameSync(
|
fs.renameSync(
|
||||||
path.join(usersDirPath, path.basename(backupHomeDir)),
|
path.join(usersDirPath, path.basename(backupHomeDir)),
|
||||||
path.join(usersDirPath, path.basename(currentHomeDir))
|
path.join(usersDirPath, path.basename(currentHomeDir))
|
||||||
@ -78,6 +73,13 @@ const downloadGameArtifact = async (
|
|||||||
const zipLocation = path.join(app.getPath("userData"), objectKey);
|
const zipLocation = path.join(app.getPath("userData"), objectKey);
|
||||||
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
||||||
|
|
||||||
|
if (fs.existsSync(backupPath)) {
|
||||||
|
fs.rmSync(backupPath, {
|
||||||
|
recursive: true,
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const response = await axios.get(downloadUrl, {
|
const response = await axios.get(downloadUrl, {
|
||||||
responseType: "stream",
|
responseType: "stream",
|
||||||
onDownloadProgress: (progressEvent) => {
|
onDownloadProgress: (progressEvent) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user