Permit overriding dotnet path (#96)

This commit is contained in:
Patrick Stevens
2025-05-16 20:54:57 +01:00
committed by GitHub
parent 5a7eb63590
commit b1cae0acb7

View File

@@ -188,7 +188,11 @@ public record DotnetEnvironmentInfo(
/// <exception cref="Exception">Throws on any failure; handles nothing gracefully.</exception>
public static DotnetEnvironmentInfo Get()
{
var dotnetExe = LocateDotnetExe();
var dotnetExe = Environment.GetEnvironmentVariable("WOOFWARE_DOTNET_LOCATOR_DOTNET_EXE") switch
{
null => LocateDotnetExe(),
var s => new FileInfo(s)
};
// `null` can happen! Maybe we're self-contained.
return GetSpecific(dotnetExe);