Corrected REMOVE_OLD_MODS to process file-wise (#2317)

This commit is contained in:
Geoff Bourne 2023-08-03 13:04:26 -05:00 committed by GitHub
parent 2fbe2bbe68
commit 3ffcbb32dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,14 +208,17 @@ eula=${EULA,,}
function removeOldMods {
if [ -d "$1" ]; then
log "Removing old mods including:${REMOVE_OLD_MODS_INCLUDE} excluding:${REMOVE_OLD_MODS_EXCLUDE}"
mc-image-helper find \
--delete \
--type file,directory \
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}" \
--name "${REMOVE_OLD_MODS_INCLUDE:-*}" \
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}" \
--quiet \
"$1"
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:-}"
)
if ! isDebugging; then
args+=(--quiet)
fi
mc-image-helper find "${args[@]}" "$1"
fi
}