Skip to content

Commit

Permalink
Merge pull request #16945 from tamasvajk/feature/buildless-determinis…
Browse files Browse the repository at this point in the history
…tic-file-order

C#: Order files in buildless extraction
  • Loading branch information
tamasvajk authored Jul 10, 2024
2 parents f183382 + ccf56a2 commit 57efb84
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private string[] SelectTextFileNamesByExtension(string filetype, params string[]
private string[] SelectTextFileNamesByName(string name)
{
var ret = allNonBinary.Value.SelectFileNamesByName(name).ToArray();
var ending = ret.Length == 0 ? "." : $": {string.Join(", ", ret.OrderBy(s => s))}.";
var ending = ret.Length == 0 ? "." : $": {string.Join(", ", ret)}.";
logger.LogInfo($"Found {ret.Length} {name} files in {SourceDir}{ending}");
return ret;
}
Expand Down Expand Up @@ -91,7 +91,9 @@ private IEnumerable<FileInfo> SelectSmallFiles(IEnumerable<FileInfo> files)
private FileInfo[] GetAllFiles()
{
logger.LogInfo($"Finding files in {SourceDir}...");
var files = SourceDir.GetFiles("*.*", new EnumerationOptions { RecurseSubdirectories = true });
var files = SourceDir
.GetFiles("*.*", new EnumerationOptions { RecurseSubdirectories = true })
.OrderBy(f => f.FullName);

var filteredFiles = files.Where(f =>
{
Expand Down

0 comments on commit 57efb84

Please sign in to comment.