Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Frends.Files.Delete/Frends.Files.Delete/Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ internal static PatternMatchingResult FindMatchingFiles(string directoryPath, st
throw new DirectoryNotFoundException($"Directory does not exist or you do not have read access. Tried to access directory '{directoryPath}'");

var matcher = new Matcher();
matcher.AddInclude(pattern);

var patterns = pattern.Split('|', StringSplitOptions.RemoveEmptyEntries);

// Add each pattern separately to the matcher
foreach (var individualPattern in patterns)
{
matcher.AddInclude(individualPattern.Trim());
}

var results = matcher.Execute(new DirectoryInfoWrapper(new DirectoryInfo(directoryPath)));
return results;
}
Expand All @@ -139,4 +147,4 @@ private static void OnPluginUnloadingRequested(AssemblyLoadContext obj)
{
obj.Unloading -= OnPluginUnloadingRequested;
}
}
}