-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcheck-updates.sh
executable file
·39 lines (34 loc) · 1004 Bytes
/
check-updates.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/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