Add REMOVE_OLD_CONFIGS to clear old configs before modpack install (#4266)

This commit is contained in:
alberto-is
2026-09-17 07:25:14 -05:00
committed by GitHub
parent efade6567b
commit 22749e08b7
8 changed files with 75 additions and 0 deletions
+17
View File
@@ -547,6 +547,23 @@ function removeOldMods {
fi
}
function removeOldConfigs {
if [ -d "$1" ]; then
log "Removing old configs including='${REMOVE_OLD_CONFIGS_INCLUDE}' excluding='${REMOVE_OLD_CONFIGS_EXCLUDE}' up to depth=${REMOVE_OLD_CONFIGS_DEPTH}"
args=(
--delete
--type file
--min-depth=1 --max-depth "${REMOVE_OLD_CONFIGS_DEPTH}"
--name "${REMOVE_OLD_CONFIGS_INCLUDE}"
--exclude-name "${REMOVE_OLD_CONFIGS_EXCLUDE}"
)
if ! isDebugging; then
args+=(--quiet)
fi
mc-image-helper find "${args[@]}" "$1"
fi
}
function get() {
mc-image-helper get "$@"
}