Enhanced download URL logic to try both known attributes

For #31
This commit is contained in:
Geoff Bourne committed 2020-03-02 15:06:53 -06:00
1 parent 3cb5d4eecc
commit 5e1f00e044
1 file changed
+6 -1
+6 -1
View File
@@ -26,7 +26,12 @@ case ${VERSION} in
VERSION=1.14.30.2 VERSION=1.14.30.2
;; ;;
*) *)
DOWNLOAD_URL=$(restify --attribute=data-bi-prtid=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/ | jq -r '.[0].href') for a in data-bi-prtid data-platform; do
DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/ 2> /dev/null | jq -r '.[0].href' || echo '')
if [[ ${DOWNLOAD_URL} ]]; then
break
fi
done
if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then
VERSION=${BASH_REMATCH[1]} VERSION=${BASH_REMATCH[1]}
else else