pantheon.updateScript: always use github api

Unfortunately elementary has suddenly decided to add ${version}-debian
tags into the mix which ls-remote will always sort last. I believe these tags
point to the deb-packaging branches in the repo's which we certainly
don't ever want to use as they contain no source.
This commit is contained in:
worldofpeace 2019-10-31 17:45:07 -04:00
parent 7a4ea26f2e
commit 5bb5c188c4

View file

@ -114,13 +114,7 @@ EOF
function get_latest_tag ( ) {
repo_name="$1"
# Using github release api because sorting this repo just doesn't work because of old git sillyness
# Also too lazy to care to adapt `git ls-remote` command to work with it
if [ $repo_name == "switchboard-plug-pantheon-shell" ]; then
curl --silent --show-error --fail -X GET "https://api.github.com/repos/elementary/$repo_name/releases/latest" | jq -r '.tag_name'
else
git ls-remote --tags --sort="v:refname" "https://github.com/elementary/$repo_name" | tail -n1 | sed 's/.*\///; s/\^{}//'
fi
curl --silent --show-error --fail -X GET "https://api.github.com/repos/elementary/$repo_name/releases/latest" | jq -r '.tag_name'
}
#