diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml index 9eb49fc..c762d7f 100644 --- a/.github/workflows/dotnet.yaml +++ b/.github/workflows/dotnet.yaml @@ -233,7 +233,7 @@ jobs: if: steps.publish-success.outputs.result == 'published' env: PACKAGE_VERSION: ${{ steps.publish-success.outputs.version }} - run: 'echo "$PACKAGE_VERSION" && while ! curl --fail -o from-nuget.nupkg "https://www.nuget.org/api/v2/package/WoofWare.DotnetRuntimeLocator/$PACKAGE_VERSION" ; do sleep 10; done' + run: 'echo "$PACKAGE_VERSION" && while ! curl -L --fail -o from-nuget.nupkg "https://www.nuget.org/api/v2/package/WoofWare.DotnetRuntimeLocator/$PACKAGE_VERSION" ; do sleep 10; done' # Astonishingly, NuGet.org considers it to be "more secure" to tamper with my package after upload (https://devblogs.microsoft.com/nuget/introducing-repository-signatures/). # So we have to *re-attest* it after it's uploaded. Mind-blowing. - name: Assert package contents diff --git a/WoofWare.DotnetRuntimeLocator/DotnetEnvironmentInfo.cs b/WoofWare.DotnetRuntimeLocator/DotnetEnvironmentInfo.cs index 2fa2a19..10836f4 100644 --- a/WoofWare.DotnetRuntimeLocator/DotnetEnvironmentInfo.cs +++ b/WoofWare.DotnetRuntimeLocator/DotnetEnvironmentInfo.cs @@ -52,14 +52,11 @@ public record DotnetEnvironmentInfo( var parent3 = parent2.Parent ?? throw new Exception("Unable to locate the host/fxr directory in the .NET runtime"); var fxrDir = new DirectoryInfo(Path.Combine(parent3.FullName, "host", "fxr")); + // Until net6, libhostfxr did not contain the entrypoint we use, and I can't be bothered to reimplement + // it on those runtimes. I'm just going to assume you have no runtimes earlier than 3 installed. Func isAcceptableName = - di => - { - // Until net6, libhostfxr did not contain the entrypoint we use, and I can't be bothered to reimplement - // it on those runtimes. I'm just going to assume you have no runtimes earlier than 3 installed. - return !di.Name.StartsWith("3.", StringComparison.Ordinal) && - !di.Name.StartsWith("5.", StringComparison.Ordinal); - }; + di => !di.Name.StartsWith("3.", StringComparison.Ordinal) && + !di.Name.StartsWith("5.", StringComparison.Ordinal); return fxrDir.EnumerateDirectories().First(isAcceptableName).EnumerateFiles("*hostfxr*").First(); });