nixos/firmware: make compression configurable (#364924)
[NixPkgs.git] / pkgs / build-support / dotnet / build-dotnet-global-tool / update.sh
blobe00fae9ace36f8d418fba6e5fb4655424744fa5e
1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p curl jq nix common-updater-scripts
3 # shellcheck shell=bash
5 set -euo pipefail
7 attr=$UPDATE_NIX_ATTR_PATH
9 nixeval() {
10 nix --extra-experimental-features nix-command eval --json --impure -f . "$1" | jq -r .
13 nugetName=$(nixeval "$attr.nupkg.pname")
15 # always skip prerelease versions for now
16 version=$(curl -fsSL "https://api.nuget.org/v3-flatcontainer/$nugetName/index.json" |
17 jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+$")))')
19 if [[ $version == $(nixeval "$attr.version") ]]; then
20 echo "$attr" is already version "$version"
21 exit 0
24 update-source-version "$attr" "$version" --source-key=nupkg.src