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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View file

@ -1,6 +1,5 @@
# NOTE
# This file is named spiget with an "e"
# since it provides an example of the
# This file is purposely named spiget with an "e" since it provides an example of the
# feature https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/spiget/
# which uses the Spiget API at https://spiget.org/
@ -13,8 +12,6 @@ services:
EULA: "TRUE"
TYPE: PAPER
SPIGET_RESOURCES: 34315,3836
REMOVE_OLD_MODS: true
volumes:
- data:/data
volumes:
data: {}
- ./data:/data

View file

@ -8,7 +8,10 @@ handleDebugMode
: "${SPIGET_RESOURCES:=}"
: "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes
: "${REMOVE_OLD_MODS:=false}"
: "${REMOVE_OLD_MODS_EXCLUDE:=}"
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
: "${REMOVE_OLD_MODS_DEPTH:=1} "
acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)
@ -127,7 +130,7 @@ downloadResourceFromSpiget() {
}
if [[ ${SPIGET_RESOURCES} ]]; then
if isTrue "${REMOVE_OLD_MODS:-false}"; then
if isTrue "${REMOVE_OLD_MODS}"; then
removeOldMods /data/plugins
REMOVE_OLD_MODS=false
fi

View file

@ -207,13 +207,13 @@ eula=${EULA,,}
function removeOldMods {
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=(
--delete
--type file
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}"
--name "${REMOVE_OLD_MODS_INCLUDE:-*}"
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}"
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH}"
--name "${REMOVE_OLD_MODS_INCLUDE}"
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE}"
)
if ! isDebugging; then
args+=(--quiet)