Skip to content

Commit

Permalink
Fixed files that should have been kept that were deleted when updatin…
Browse files Browse the repository at this point in the history
…g a plugin.
  • Loading branch information
maforget committed Jun 14, 2024
1 parent a398f73 commit b8c4e9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ComicRack.Engine/PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ private bool CommitInstallPackage(Package package)
return new Regex(regexPattern, RegexOptions.IgnoreCase);
}).ToList();

foreach (string item in from f in Directory.EnumerateFiles(text)
foreach (string item in from f in new DirectoryInfo(text).EnumerateFiles().Select(x => x.Name)
where !keepPatterns.Any(regex => regex.IsMatch(f))
select f)
{
FileUtility.SafeDelete(item);
}

foreach (string item2 in from f in Directory.EnumerateDirectories(text)
where !keepPatterns.Any(regex => regex.IsMatch(f))
foreach (string item2 in from f in new DirectoryInfo(text).EnumerateDirectories().Select(x => x.Name)
where !keepPatterns.Any(regex => regex.IsMatch(f))
select f)
{
FileUtility.SafeDirectoryDelete(item2);
Expand Down

0 comments on commit b8c4e9c

Please sign in to comment.