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

This commit is contained in:
Louis Seubert 2026-08-25 19:46:07 +02:00 committed by louis9902
commit 77199944fe

View file

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