fix: should still ignore non-PE files when signExclude is provided

This commit is contained in:
Caelan Sayler
2025-03-23 15:42:08 +00:00
committed by Caelan
parent 4b1116a791
commit f0a1186245

View File

@@ -25,7 +25,8 @@ public class WindowsPackCommandRunner : PackageBuilder<WindowsPackOptions>
{
Regex fileExcludeRegex = Options.SignExclude != null ? new Regex(Options.SignExclude) : null;
var filesToSign = new DirectoryInfo(packDir).GetAllFilesRecursively()
.Where(x => !fileExcludeRegex?.IsMatch(x.FullName) ?? PathUtil.FileIsLikelyPEImage(x.Name))
.Where(x => PathUtil.FileIsLikelyPEImage(x.Name))
.Where(x => fileExcludeRegex != null ? !fileExcludeRegex.IsMatch(x.FullName) : true)
.Select(x => x.FullName)
.ToArray();