summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Endfinger2020-01-13 20:11:35 -0500
committerKenneth Endfinger2020-01-13 20:11:35 -0500
commit5e261b30739cb1696b51302b6f1f61f25e9082a2 (patch)
tree3fa7abf714f7776cd53b2d2229146991fa839084
parent33f47f569fc3a4a5809848fdf3b674c19661ef20 (diff)
downloadaur-5e261b30739cb1696b51302b6f1f61f25e9082a2.tar.gz
Add check-for-update.sh script.
-rwxr-xr-xcheck-for-update.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/check-for-update.sh b/check-for-update.sh
new file mode 100755
index 000000000000..09f1fcbd55b1
--- /dev/null
+++ b/check-for-update.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+cd $(dirname "${0}")
+
+REPOSITORY="EliverLara/Ant"
+
+PKG=$(cat .SRCINFO | grep "pkgbase" | head -n1 | awk '{print $3}')
+CURRENT=$(cat .SRCINFO | grep "pkgver" | head -n1 | awk '{print $3}')
+LATEST=$(curl --silent -L "https://api.github.com/repos/${REPOSITORY}/tags" | jq -r '.[].name' | grep -v -- "-" | head -n1 | sed 's/^v//g')
+if [ "${LATEST}" != "${CURRENT}" ]
+then
+ echo "${PKG} : AUR ${CURRENT} != GitHub ${LATEST}"
+ exit 1
+fi
+echo "${PKG} : AUR ${CURRENT} == GitHub ${LATEST}"
+exit 0