Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 18 lines 946 B view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -I nixpkgs=./. -i bash -p common-updater-scripts coreutils curl gnused jq nix nix-prefetch-git nix-prefetch-github ripgrep 3 4set -euo pipefail 5 6latestRev="$(curl -s "https://api.github.com/repos/ralph-irving/squeezelite/commits?per_page=1" | jq -r ".[0].sha")" 7latestVersion="$( curl -s https://raw.githubusercontent.com/ralph-irving/squeezelite/${latestRev}/squeezelite.h | rg 'define (MAJOR|MINOR|MICRO)_VERSION' | sed 's/#.*VERSION //' | tr '\n' '.' | sed -e 's/"//g' -e 's/\.$//')" 8currentVersion=$(nix-instantiate --eval -E "with import ./. {}; squeezelite.version or (lib.getVersion squeezelite)" | tr -d '"') 9 10if [[ "$currentVersion" == "$latestVersion" ]]; then 11 echo "squeezelite is up-to-date: $currentVersion" 12 exit 0 13fi 14 15srcHash=$(nix-prefetch-github ralph-irving squeezelite --rev "$latestRev" | jq -r .hash) 16 17 18update-source-version squeezelite "$latestVersion" "$srcHash" --rev="${latestRev}"