jql: 8.0.0 -> 8.0.2 (#362884)
[NixPkgs.git] / pkgs / applications / version-management / git-credential-manager / update.sh
blobfc9ef4199678d54794e4327ace1556f6bb1c10b7
1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
3 set -eo pipefail
4 cd "$(dirname "${BASH_SOURCE[0]}")"
6 new_version="$(curl -s "https://api.github.com/repos/git-ecosystem/git-credential-manager/releases?per_page=1" | jq -r '.[0].name' | sed 's|^GCM ||')"
7 old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
8 if [[ "$new_version" == "$old_version" ]]; then
9 echo "Up to date"
10 exit 0
13 cd ../../../..
14 update-source-version git-credential-manager "$new_version"
15 $(nix-build -A git-credential-manager.fetch-deps --no-out-link)