Skip to content

Commit e6bed1d

Browse files
committed
Update OsSettingsResolver.cs
1 parent b78a61a commit e6bed1d

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

src/DiffEngine/OsSettingsResolver.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,23 @@ static bool TryResolveForOs(
6666
var basePath = Environment.GetEnvironmentVariable(os.EnvironmentVariable);
6767
if (basePath is not null)
6868
{
69-
if (basePath.EndsWith(os.ExeName) && File.Exists(basePath))
69+
if (basePath.EndsWith(os.ExeName) &&
70+
File.Exists(basePath))
7071
{
72+
path = basePath;
73+
return true;
7174
}
72-
else if (Directory.Exists(basePath))
73-
{
74-
basePath = Path.Combine(basePath, os.ExeName);
75-
}
76-
else
77-
{
78-
path = null;
79-
return false;
80-
}
81-
if (WildcardFileFinder.TryFind(basePath, out path))
75+
76+
if (Directory.Exists(basePath))
8277
{
83-
return true;
78+
path = Path.Combine(basePath, os.ExeName);
79+
if (File.Exists(path))
80+
{
81+
return true;
82+
}
8483
}
84+
85+
throw new($"Could not find exe defined by {os.EnvironmentVariable}. Path: {basePath}");
8586
}
8687
}
8788

0 commit comments

Comments
 (0)