2022-01-05 20:03:04 +01:00
|
|
|
#!/usr/bin/env nix-shell
|
2022-11-24 00:25:36 +01:00
|
|
|
#!nix-shell -i bash -p curl jq nix nix-update patchutils
|
2022-01-05 20:03:04 +01:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
info() {
|
|
|
|
if [ -t 2 ]; then
|
|
|
|
set -- '\033[32m%s\033[39m\n' "$@"
|
|
|
|
else
|
|
|
|
set -- '%s\n' "$@"
|
|
|
|
fi
|
|
|
|
printf "$@" >&2
|
|
|
|
}
|
|
|
|
|
|
|
|
nitter_old_rev=$(nix-instantiate --eval --strict --json -A nitter.src.rev . | jq -r .)
|
2022-11-24 00:25:36 +01:00
|
|
|
nix-update --version=branch --commit nitter
|
|
|
|
nitter_new_rev=$(nix-instantiate --eval --strict --json -A nitter.src.rev . | jq -r .)
|
2022-01-05 20:03:04 +01:00
|
|
|
if [ "$nitter_new_rev" = "$nitter_old_rev" ]; then
|
|
|
|
info "nitter is up-to-date."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if curl -Sfs "https://github.com/zedeus/nitter/compare/$nitter_old_rev...$nitter_new_rev.patch" \
|
|
|
|
| lsdiff | grep -Fxe 'a/nitter.nimble' -e 'b/nitter.nimble' > /dev/null; then
|
|
|
|
info "nitter.nimble changed, some dependencies probably need updating."
|
|
|
|
fi
|