Skip to content

Commit 94bfd0f

Browse files
committed
Fix exclusion filters in CopyAllFiles
1 parent 4c1435e commit 94bfd0f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Plugins/GolaemPlugin/Source/CrowdModule/GolaemMacros.Build.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,20 @@ public static void CopyAllFiles(DirectoryInfo source, DirectoryInfo target, List
9898
// Copy each file into the new directory.
9999
foreach (FileInfo fi in source.GetFiles())
100100
{
101-
if (excludeFilters == null || !excludeFilters.Contains(fi.Extension))
101+
bool isExcluded = false;
102+
if (excludeFilters != null)
103+
{
104+
foreach (string filter in excludeFilters)
105+
{
106+
if (fi.Name.EndsWith(filter))
107+
{
108+
Console.WriteLine(fi.FullName + " is excluded by filter " + filter);
109+
isExcluded = true;
110+
break;
111+
}
112+
}
113+
}
114+
if (!isExcluded)
102115
{
103116
Console.WriteLine(@"Copying {0}\{1}", target.FullName, fi.Name);
104117
fi.CopyTo(Path.Combine(target.FullName, fi.Name), true);

0 commit comments

Comments
 (0)