chore: tidy up windows path resolution syntax #4

Merged
louis9902 merged 1 commit from feature/tidyup_path_resolution into main 2026-08-25 17:54:51 +00:00
Showing only changes of commit 1b9b5284bd - Show all commits

chore: tidy up windows path resolution syntax
All checks were successful
default / dotnet-default-workflow (pull_request) Successful in 1m22s

Louis Seubert 2026-08-25 19:46:07 +02:00

View file

@ -75,15 +75,11 @@ public sealed partial class Command
return TargetFilePath; return TargetFilePath;
} }
return ( return GetProbeDirectoryPaths()
from probeDirPath in GetProbeDirectoryPaths() .Where(Directory.Exists)
where Directory.Exists(probeDirPath) .Select(path => Path.Combine(path, TargetFilePath))
select Path.Combine(probeDirPath, TargetFilePath) .SelectMany(static _ => GetPathExtensions(), static (path, extension) => Path.ChangeExtension(path, extension))
into baseFilePath .FirstOrDefault(File.Exists) ?? TargetFilePath;
from extension in GetPathExtensions()
select Path.ChangeExtension(baseFilePath, extension)
).FirstOrDefault(File.Exists) ??
TargetFilePath;
static IEnumerable<string> GetProbeDirectoryPaths() static IEnumerable<string> GetProbeDirectoryPaths()
{ {