add check for absolute directories to world copy script (#2939)

This commit is contained in:
Connor
2024-07-01 05:47:42 -07:00
committed by GitHub
parent 14a8f903ae
commit 50caaf98ef

View File

@@ -5,10 +5,15 @@
set -e
isDebugging && set -x
if [ "$TYPE" = "CURSEFORGE" ]; then
worldDest=$FTB_DIR/${LEVEL:-world}
# support absolute directories
if [[ "${LEVEL:-world}" =~ ^\/.*$ ]]; then
worldDest=${LEVEL}
else
worldDest=/data/${LEVEL:-world}
if [ "$TYPE" = "CURSEFORGE" ]; then
worldDest=$FTB_DIR/${LEVEL:-world}
else
worldDest=/data/${LEVEL:-world}
fi
fi
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then