Fixed issue of unbound REMOVE_OLD_MODS_EXCLUDE variable when using SPIGET_RESOURCES (#2891)

This commit is contained in:
Geoff Bourne
2024-06-12 16:38:41 -05:00
committed by GitHub
parent 87afad69b3
commit 2e9be596f7
3 changed files with 11 additions and 11 deletions
@@ -1,6 +1,5 @@
# NOTE # NOTE
# This file is named spiget with an "e" # This file is purposely named spiget with an "e" since it provides an example of the
# since it provides an example of the
# feature https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/spiget/ # feature https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/spiget/
# which uses the Spiget API at https://spiget.org/ # which uses the Spiget API at https://spiget.org/
@@ -13,8 +12,6 @@ services:
EULA: "TRUE" EULA: "TRUE"
TYPE: PAPER TYPE: PAPER
SPIGET_RESOURCES: 34315,3836 SPIGET_RESOURCES: 34315,3836
REMOVE_OLD_MODS: true
volumes: volumes:
- data:/data - ./data:/data
volumes:
data: {}
+4 -1
View File
@@ -8,7 +8,10 @@ handleDebugMode
: "${SPIGET_RESOURCES:=}" : "${SPIGET_RESOURCES:=}"
: "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes : "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes
: "${REMOVE_OLD_MODS:=false}"
: "${REMOVE_OLD_MODS_EXCLUDE:=}"
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}" : "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
: "${REMOVE_OLD_MODS_DEPTH:=1} "
acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream) acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)
@@ -127,7 +130,7 @@ downloadResourceFromSpiget() {
} }
if [[ ${SPIGET_RESOURCES} ]]; then if [[ ${SPIGET_RESOURCES} ]]; then
if isTrue "${REMOVE_OLD_MODS:-false}"; then if isTrue "${REMOVE_OLD_MODS}"; then
removeOldMods /data/plugins removeOldMods /data/plugins
REMOVE_OLD_MODS=false REMOVE_OLD_MODS=false
fi fi
+4 -4
View File
@@ -207,13 +207,13 @@ eula=${EULA,,}
function removeOldMods { function removeOldMods {
if [ -d "$1" ]; then if [ -d "$1" ]; then
log "Removing old mods including:${REMOVE_OLD_MODS_INCLUDE} excluding:${REMOVE_OLD_MODS_EXCLUDE}" log "Removing old mods including='${REMOVE_OLD_MODS_INCLUDE}' excluding='${REMOVE_OLD_MODS_EXCLUDE}' up to depth=${REMOVE_OLD_MODS_DEPTH}"
args=( args=(
--delete --delete
--type file --type file
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}" --min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH}"
--name "${REMOVE_OLD_MODS_INCLUDE:-*}" --name "${REMOVE_OLD_MODS_INCLUDE}"
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}" --exclude-name "${REMOVE_OLD_MODS_EXCLUDE}"
) )
if ! isDebugging; then if ! isDebugging; then
args+=(--quiet) args+=(--quiet)