fix: Fixes directory copying (#1668)

This commit is contained in:
Kamron Batman 2024-02-09 23:25:20 -08:00 committed by GitHub
parent 00332e542d
commit 3244704ea2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 58 additions and 15 deletions

View file

@ -97,7 +97,7 @@ namespace Server.Saves
Directory.CreateDirectory(AutomaticBackupPath);
var backupPath = Path.Combine(AutomaticBackupPath, Utility.GetTimeStamp());
PathUtility.MoveDirectory(args.OldSavePath, backupPath);
PathUtility.MoveDirectoryContents(args.OldSavePath, backupPath);
logger.Information("Created backup at {Path}", backupPath);
@ -150,7 +150,7 @@ namespace Server.Saves
Directory.Delete(savePath, true);
var dirInfo = new DirectoryInfo(folder);
logger.Information("Restoring backup {Directory}", dirInfo.Name);
PathUtility.MoveDirectory(folder, savePath);
PathUtility.MoveDirectoryContents(folder, savePath);
break;
}