Handle various versions of Magma Maintained (#2563)

This commit is contained in:
streaminganger 2023-12-29 22:57:13 +08:00 committed by GitHub
parent 7fa522853f
commit cbd1e8d86d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,18 +9,23 @@ isDebugging && set -x
resolveVersion
if [ -z $VERSION ]; then
log "ERROR the variable VERSION is not specified"
exit 1
fi
if [ -z $MAGMA_MAINTAINED_TAG ]; then
log "ERROR the variable MAGMA_MAINTAINED_TAG is not specified"
exit 1
fi
# https://github.com/magmamaintained/Magma-1.12.2/releases/download/88659fb/Magma-1.12.2-88659fb-server.jar
downloadUrl="https://github.com/magmamaintained/Magma-${VERSION}/releases/download/${MAGMA_MAINTAINED_TAG}/magma-${VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
# Magma-1.12.2/releases/download/88659fb/Magma-1.12.2-88659fb-server.jar
# Magma-1.20.1/releases/download/adec9ce/magma-1.20.1-47.2.17-adec9ce-server.jar
if [[ ${VERSION} = "1.12.2" ]]; then
fileName="Magma-${VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
else
if [ -z $FORGE_VERSION ]; then
log "ERROR the variable FORGE_VERSION is not specified"
exit 1
fi
fileName="magma-${VERSION}-${FORGE_VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
fi
downloadUrl="https://github.com/magmamaintained/Magma-${VERSION}/releases/download/${MAGMA_MAINTAINED_TAG}/${fileName}"
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
log "ERROR: failed to download Magma Maintained server jar from $downloadUrl"