dotnet-sdk: update.sh - fail if determining a nuget hash fails

(cherry picked from commit f79c73c2ca)
This commit is contained in:
mdarocha
2023-07-14 00:51:15 +02:00
committed by github-actions[bot]
parent 9462344318
commit c4e4ed5cf8

View File

@@ -64,6 +64,11 @@ generate_package_list() {
local url hash
url="${nuget_url}${pkg,,}/${version,,}/${pkg,,}.${version,,}.nupkg"
hash="$(nix-prefetch-url "$url")"
if [[ -z "$hash" ]]; then
echo "Failed to fetch hash for $url" >&2
exit 1
fi
echo " (fetchNuGet { pname = \"${pkg}\"; version = \"${version}\"; sha256 = \"${hash}\"; })"
done
}