Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / ArchiSteamFarm / update.sh
blob53d3ee6641912b7514e4138265accb5f340a2fcf
1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq common-updater-scripts
3 set -euo pipefail
4 cd "$(dirname "${BASH_SOURCE[0]}")"
6 new_version="$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} -s "https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/releases" | jq -r 'map(select(.prerelease == false)) | .[0].tag_name')"
7 old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
9 if [[ "$new_version" == "$old_version" ]]; then
10 echo "Already up to date!"
11 if [[ "${1-default}" != "--deps-only" ]]; then
12 exit 0
16 asf_path=$PWD
17 cd ../../../..
19 if [[ "${1:-}" != "--deps-only" ]]; then
20 update-source-version ArchiSteamFarm "$new_version"
23 $(nix-build -A ArchiSteamFarm.fetch-deps --no-out-link)
25 cd "$asf_path/web-ui"
26 ./update.sh