depot/pkgs/by-name/ca/cavalier/update.sh
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

18 lines
619 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
#shellcheck shell=bash
set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/NickvisionApps/Cavalier/releases/latest | jq -e -r .tag_name)
old_version=$(nix-instantiate --eval -A cavalier.version | jq -e -r)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2
exit 0
fi
update-source-version cavalier "$version"
$(nix-build -A cavalier.fetch-deps --no-out-link) "$(dirname -- "${BASH_SOURCE[0]}")/deps.nix"