From 5edf7813abcd081cdbbf5ab14eb86f10de148926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20James?= Date: Sat, 18 Jan 2025 11:30:14 +0100 Subject: [PATCH] buildDotnetModule: add support for installing pre-release tools --- pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix | 2 +- pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix b/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix index 206aea51f26345..82137b30e24c07 100644 --- a/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix @@ -60,7 +60,7 @@ buildDotnetModule ( installPhase = '' runHook preInstall - dotnet tool install --tool-path $out/lib/${pname} ${nugetName} + dotnet tool install --tool-path $out/lib/${pname} ${nugetName} --version ${version} # remove files that contain nix store paths to temp nuget sources we made find $out -name 'project.assets.json' -delete diff --git a/pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh b/pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh index e00fae9ace36f8..9214b56d6240d3 100755 --- a/pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh +++ b/pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh @@ -14,7 +14,7 @@ nugetName=$(nixeval "$attr.nupkg.pname") # always skip prerelease versions for now version=$(curl -fsSL "https://api.nuget.org/v3-flatcontainer/$nugetName/index.json" | - jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+$")))') + jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$")))') if [[ $version == $(nixeval "$attr.version") ]]; then echo "$attr" is already version "$version"