From 30228af19e1638977ba001cebb4fd9fd8c333366 Mon Sep 17 00:00:00 2001 From: ipitio <21136719+ipitio@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:27:38 +0000 Subject: [PATCH] improve grep (#107) --- advanced/Scripts/updatecheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 13760d8504..5716f4b5ba 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -19,7 +19,7 @@ function get_local_version() { cd "${1}" 2> /dev/null || return 1 local tags=$(git ls-remote -t origin) local foundVersion=$(git rev-parse HEAD 2>/dev/null) - ! grep -q "$foundVersion" <<<"$tags" || foundVersion=$(grep "$foundVersion" <<<"$tags" | awk '{print $2;}' | cut -d '/' -f 3 | sort -V | tail -n1) + ! grep -q "^$foundVersion" <<<"$tags" || foundVersion=$(grep "^$foundVersion.*/v[0-9].*$" <<<"$tags" | awk '{print $2;}' | cut -d '/' -f 3 | sort -V | tail -n1) echo "${foundVersion}" }