mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
fix: fixing multiple folders
This commit is contained in:
parent
f6acfa4aee
commit
0222121288
@ -36,10 +36,20 @@ const replaceLudusaviBackupWithCurrentUser = (
|
||||
// TODO: Only works on Windows
|
||||
const usersDirPath = path.join(gameBackupPath, "drive-C", "Users");
|
||||
|
||||
fs.renameSync(
|
||||
path.join(usersDirPath, path.basename(backupHomeDir)),
|
||||
path.join(usersDirPath, path.basename(currentHomeDir))
|
||||
);
|
||||
const oldPath = path.join(usersDirPath, path.basename(backupHomeDir));
|
||||
const newPath = path.join(usersDirPath, path.basename(currentHomeDir));
|
||||
|
||||
// Directories are different, rename
|
||||
if (backupHomeDir !== currentHomeDir) {
|
||||
if (fs.existsSync(newPath)) {
|
||||
fs.rmSync(newPath, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
}
|
||||
|
||||
fs.renameSync(oldPath, newPath);
|
||||
}
|
||||
|
||||
const backups = manifest.backups.map((backup: LudusaviBackup) => {
|
||||
const files = Object.entries(backup.files).reduce((prev, [key, value]) => {
|
||||
|
Loading…
Reference in New Issue
Block a user