Skip to content

Commit

Permalink
BuildTools: Add exclude signing
Browse files Browse the repository at this point in the history
  • Loading branch information
dmex committed Jan 29, 2025
1 parent 4eab430 commit 8566b1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/CustomBuildTool/EntraKeyVault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ string ClientSecret
{
if (Directory.Exists(Path))
{
var files = Utils.EnumerateDirectory(Path, [".exe", ".dll"]);
var files = Utils.EnumerateDirectory(Path, [".exe", ".dll"], ["ksi.dll"]);

if (files == null || files.Count == 0)
{
Expand Down
11 changes: 9 additions & 2 deletions tools/CustomBuildTool/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,20 @@ public static string ExecuteGitCommand(string WorkingFolder, string Command)
return output;
}

public static List<string> EnumerateDirectory(string FilePath, string[] Extensions)
public static List<string> EnumerateDirectory(string FilePath, string[] Extensions, string[] Exclude = null)
{
return Directory.EnumerateFiles(FilePath, "*", new EnumerationOptions
var list = Directory.EnumerateFiles(FilePath, "*", new EnumerationOptions
{
RecurseSubdirectories = true,
ReturnSpecialDirectories = false
}).Where(s => Extensions.Any(ext => string.Equals(ext, Path.GetExtension(s), StringComparison.OrdinalIgnoreCase))).ToList();

if (Exclude != null)
{
list.RemoveAll(s => Exclude.Any(f => f.Equals(s, StringComparison.OrdinalIgnoreCase)));
}

return list;
}

public static string GetWindowsSdkIncludePath()
Expand Down

0 comments on commit 8566b1e

Please sign in to comment.