1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p curl jq nix common-updater-scripts
3 # shellcheck shell=bash
7 attr
=$UPDATE_NIX_ATTR_PATH
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"
24 update-source-version
"$attr" "$version" --source-key=nupkg.src