a fix for how this script detect versions in github

Replaced it with the one from functions.sh
This commit is contained in:
Søren Theilgaard
2022-08-23 13:37:30 +02:00
parent 25c39caafc
commit f689f7e10c

View File

@@ -63,7 +63,7 @@ versionFromGit() { # $1 git user name, $2 git repo name
gitusername=${1?:"no git user name"}
gitreponame=${2?:"no git repo name"}
appNewVersion=$(curl --silent --fail "https://github.com/$gitusername/$gitreponame/releases/latest" | sed -E 's/.*tag\/(.*)\">.*/\1/g' | sed 's/[^0-9\.]//g')
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
if [ -z "$appNewVersion" ]; then
printlog "could not retrieve version number for $gitusername/$gitreponame: $appNewVersion"
exit 9