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 { 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}"
mc-image-helper find \ args=(
--delete \ --delete
--type file,directory \ --type file
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}" \ --min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}"
--name "${REMOVE_OLD_MODS_INCLUDE:-*}" \ --name "${REMOVE_OLD_MODS_INCLUDE:-*}"
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}" \ --exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}"
--quiet \ )
"$1" if ! isDebugging; then
args+=(--quiet)
fi
mc-image-helper find "${args[@]}" "$1"
fi fi
} }