From cbd1e8d86d56d6aa9904b94330bfa4d5bccc615c Mon Sep 17 00:00:00 2001 From: streaminganger <155037400+streaminganger@users.noreply.github.com> Date: Fri, 29 Dec 2023 22:57:13 +0800 Subject: [PATCH] Handle various versions of Magma Maintained (#2563) --- scripts/start-deployMagmaMaintained | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/start-deployMagmaMaintained b/scripts/start-deployMagmaMaintained index 9408488c..2f60a654 100755 --- a/scripts/start-deployMagmaMaintained +++ b/scripts/start-deployMagmaMaintained @@ -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"