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/binwiederhier/ntfy/tags" | jq
-r .
[0].name |
grep -oP "^v\K.*")
8 url
="https://raw.githubusercontent.com/binwiederhier/ntfy/v$version/"
10 if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
11 echo "Already up to date!"
15 rm -f package-lock.json
16 wget
"$url/web/package-lock.json"
17 npm_hash
=$
(prefetch-npm-deps package-lock.json
)
18 sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' default.nix
19 rm -f package-lock.json
22 nix-update ntfy-sh
--version $version