Resolve latest bukkit/spigot directly from getbukkit

Fixes #629 #631
This commit is contained in:
Geoff Bourne 2020-09-27 10:21:33 -05:00
parent 8b977f8786
commit 777ad31de0

View File

@ -58,6 +58,10 @@ function downloadSpigot {
;; ;;
esac esac
if [[ ${VERSION^^} = LATEST ]]; then
VANILLA_VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]')
fi
if [[ -z $downloadUrl ]]; then if [[ -z $downloadUrl ]]; then
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar" downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
fi fi