icecat-builds/check-updates.sh
Jeffrey Serio a8099b33d8
Some checks failed
Check for updates / pull-request (push) Has been cancelled
Initial commit
2025-03-11 23:56:06 -05:00

40 lines
1004 B
Bash
Executable File

#!/bin/bash
# Uncomment for debugging use
# set -o xtrace
set -o errexit
set -o pipefail
set -o nounset
PREV_RELEASE="102.14.0"
LATEST_RELEASE=$(curl --silent https://git.savannah.gnu.org/cgit/gnuzilla.git/log | \
grep -oP '(?<=Update to )[0-9.]+' | \
head -n 1 | \
cut -d'.' -f1-3)
function print_release {
if [[ "${LATEST_RELEASE}" != "${PREV_RELEASE}" ]]; then
if [[ "$1" != "version-only" ]]; then
echo "There's a new release of GNU IceCat."
echo "https://git.savannah.gnu.org/cgit/gnuzilla.git/log"
fi
echo "${LATEST_RELEASE} > ${PREV_RELEASE}."
else
if [[ "$1" != "version-only" ]]; then
echo "There's no new release of GNU IceCat."
echo "https://git.savannah.gnu.org/cgit/gnuzilla.git/log"
fi
echo "${LATEST_RELEASE} == ${PREV_RELEASE}."
fi
}
case "$@" in
--version-only)
print_release "version-only"
;;
*)
print_release ""
;;
esac