From 58e355d9b493ba7a190f74b8ae19f859778d2866 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 19 Dec 2021 12:05:31 +0400 Subject: [PATCH] semver requires digits --- tools/wget_semver | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/wget_semver b/tools/wget_semver index d3b95da..f157662 100755 --- a/tools/wget_semver +++ b/tools/wget_semver @@ -15,17 +15,16 @@ function usage() { } function get_github() { - local all_releases=$(git ls-remote --tags --sort="v:refname" git://github.com/$REPO_NAME) + local all_releases=$(git ls-remote --tags --sort="v:refname" git://github.com/$REPO_NAME | grep -Eo "v?([0-9]\.)+[0-9]+") # extract only VERSION without 'v' local non_v_release=$(echo "$all_releases" | - grep -v "refs/tags/v" | grep -v dev | grep -v rc | tail -n1 | cut -f2 | cut -d '/' -f3) + grep -v "refs/tags/v" | grep -v v | tail -n1 | cut -f2 | cut -d '/' -f3) non_v_release=${non_v_release%^\{\}} # remove extra characters ^{} from github [ -n "$non_v_release" ] && echo $non_v_release && return # extract remaining version including 'v' - local v_release=$(echo "$all_releases" | - grep -v dev | grep -v rc | tail -n1 | cut -f2 | cut -d '/' -f3) + local v_release=$(echo "$all_releases" | tail -n1 | cut -f2 | cut -d '/' -f3) v_release=${v_release%^\{\}} # remove extra characters ^{} from github echo $v_release }