|
@ -15,7 +15,7 @@ function usage() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function get_github() { |
|
|
function get_github() { |
|
|
local all_releases=$(git ls-remote --tags --sort="v:refname" git://github.com/"$REPO_NAME" | grep -Eo "v?([0-9]+\.){2}[0-9]+$" ) |
|
|
|
|
|
|
|
|
local all_releases=$(git ls-remote --tags --sort="v:refname" https://github.com/"$REPO_NAME" | grep -Eo "v?([0-9]+\.){2}[0-9]+$") |
|
|
|
|
|
|
|
|
# extract only VERSION without 'v' |
|
|
# extract only VERSION without 'v' |
|
|
local non_v_release=$(echo "$all_releases" | grep -v v | tail -n1 | cut -f2 | cut -d '/' -f3) |
|
|
local non_v_release=$(echo "$all_releases" | grep -v v | tail -n1 | cut -f2 | cut -d '/' -f3) |
|
@ -24,7 +24,7 @@ function get_github() { |
|
|
# extract remaining version including 'v' |
|
|
# extract remaining version including 'v' |
|
|
local v_release=$(echo "$all_releases" | 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 |
|
|
v_release=${v_release%^\{\}} # remove extra characters ^{} from github |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# compare which newer from non_v_release to v_release |
|
|
# compare which newer from non_v_release to v_release |
|
|
if [ -n "$non_v_release" ] && [ "v$non_v_release" \> "$v_release" ]; then |
|
|
if [ -n "$non_v_release" ] && [ "v$non_v_release" \> "$v_release" ]; then |
|
|
echo $non_v_release |
|
|
echo $non_v_release |
|
|