summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.SaveBackup
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 15:33:40 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 15:33:40 -0500
commit56b1b8d4d2177fbb0673672bc4b7bb49bcccc606 (patch)
tree91bcd2a386a8091eef9900efe856f4dc350584e0 /src/SMAPI.Mods.SaveBackup
parentaeb72586fdd94219cb9ae11cfd9f162765a5bc51 (diff)
downloadSMAPI-56b1b8d4d2177fbb0673672bc4b7bb49bcccc606.tar.gz
SMAPI-56b1b8d4d2177fbb0673672bc4b7bb49bcccc606.tar.bz2
SMAPI-56b1b8d4d2177fbb0673672bc4b7bb49bcccc606.zip
fix save folder filter in Save Backup
Diffstat (limited to 'src/SMAPI.Mods.SaveBackup')
-rw-r--r--src/SMAPI.Mods.SaveBackup/ModEntry.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SMAPI.Mods.SaveBackup/ModEntry.cs b/src/SMAPI.Mods.SaveBackup/ModEntry.cs
index b1d368a1..8b139d8f 100644
--- a/src/SMAPI.Mods.SaveBackup/ModEntry.cs
+++ b/src/SMAPI.Mods.SaveBackup/ModEntry.cs
@@ -71,7 +71,7 @@ namespace StardewModdingAPI.Mods.SaveBackup
// copy saves to fallback directory (ignore non-save files/folders)
this.Monitor.Log($"Backing up saves to {fallbackDir.FullName}...", LogLevel.Trace);
DirectoryInfo savesDir = new DirectoryInfo(Constants.SavesPath);
- this.RecursiveCopy(savesDir, fallbackDir, copyRoot: false, entry => this.MatchSaveFolders(savesDir, entry));
+ this.RecursiveCopy(savesDir, fallbackDir, entry => this.MatchSaveFolders(savesDir, entry), copyRoot: false);
// compress backup if possible
this.Monitor.Log("Compressing backup if possible...", LogLevel.Trace);
@@ -199,7 +199,7 @@ namespace StardewModdingAPI.Mods.SaveBackup
/// <param name="copyRoot">Whether to copy the root folder itself, or <c>false</c> to only copy its contents.</param>
/// <param name="filter">A filter which matches the files or directories to copy, or <c>null</c> to copy everything.</param>
/// <remarks>Derived from the SMAPI installer code.</remarks>
- private void RecursiveCopy(FileSystemInfo source, DirectoryInfo targetFolder, bool copyRoot = true, Func<FileSystemInfo, bool> filter = null)
+ private void RecursiveCopy(FileSystemInfo source, DirectoryInfo targetFolder, Func<FileSystemInfo, bool> filter, bool copyRoot = true)
{
if (!targetFolder.Exists)
targetFolder.Create();
@@ -216,7 +216,7 @@ namespace StardewModdingAPI.Mods.SaveBackup
case DirectoryInfo sourceDir:
DirectoryInfo targetSubfolder = copyRoot ? new DirectoryInfo(Path.Combine(targetFolder.FullName, sourceDir.Name)) : targetFolder;
foreach (var entry in sourceDir.EnumerateFileSystemInfos())
- this.RecursiveCopy(entry, targetSubfolder);
+ this.RecursiveCopy(entry, targetSubfolder, filter);
break;
default: