chore: tidy up windows path resolution syntax
All checks were successful
default / dotnet-default-workflow (push) Successful in 1m12s
All checks were successful
default / dotnet-default-workflow (push) Successful in 1m12s
This commit is contained in:
parent
25ad2b55b5
commit
77199944fe
1 changed files with 5 additions and 9 deletions
|
|
@ -73,15 +73,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()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue