Skip to content

Commit b1cae0a

Browse files
authored
Permit overriding dotnet path (#96)
1 parent 5a7eb63 commit b1cae0a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

WoofWare.DotnetRuntimeLocator/DotnetEnvironmentInfo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ public static DotnetEnvironmentInfo GetSpecific(FileInfo? dotnetExe)
188188
/// <exception cref="Exception">Throws on any failure; handles nothing gracefully.</exception>
189189
public static DotnetEnvironmentInfo Get()
190190
{
191-
var dotnetExe = LocateDotnetExe();
191+
var dotnetExe = Environment.GetEnvironmentVariable("WOOFWARE_DOTNET_LOCATOR_DOTNET_EXE") switch
192+
{
193+
null => LocateDotnetExe(),
194+
var s => new FileInfo(s)
195+
};
192196

193197
// `null` can happen! Maybe we're self-contained.
194198
return GetSpecific(dotnetExe);

0 commit comments

Comments
 (0)