1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p gnugrep gnused coreutils curl wget jq nix-update prefetch-npm-deps nodejs
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!"
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
23 nix-update sunshine
--version $version