nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 24 lines 709 B view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -I nixpkgs=./. -i bash -p curl jq nix common-updater-scripts 3# shellcheck shell=bash 4 5set -euo pipefail 6 7attr=$UPDATE_NIX_ATTR_PATH 8 9nixeval() { 10 nix --extra-experimental-features nix-command eval --json --impure -f . "$1" | jq -r . 11} 12 13nugetName=$(nixeval "$attr.nupkg.pname") 14 15# always skip prerelease versions for now 16version=$(curl -fsSL "https://api.nuget.org/v3-flatcontainer/$nugetName/index.json" | 17 jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+$")))') 18 19if [[ $version == $(nixeval "$attr.version") ]]; then 20 echo "$attr" is already version "$version" 21 exit 0 22fi 23 24update-source-version "$attr" "$version" --source-key=nupkg.src