biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / sunshine / updater.sh
blob43ae46ab6f2f935cf73f0fbf52428118f4d0333b
1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p gnugrep gnused coreutils curl wget jq nix-update prefetch-npm-deps nodejs
4 set -euo pipefail
5 pushd "$(dirname "${BASH_SOURCE[0]}")"
7 version=$(curl -s "https://api.github.com/repos/LizardByte/sunshine/tags" | jq -r .[0].name | grep -oP "^v\K.*")
8 url="https://raw.githubusercontent.com/LizardByte/sunshine/v$version/"
10 if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
11 echo "Already up to date!"
12 exit 0
15 rm -f package-lock.json package.json
16 wget "$url/package.json"
17 npm i --package-lock-only
18 npm_hash=$(prefetch-npm-deps package-lock.json)
19 sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' default.nix
20 rm -f package.json
22 popd
23 nix-update sunshine --version $version