From 6aaed2da688fd77329a8b3caad43aa190f52f652 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 9 Feb 2024 06:59:05 -0600 Subject: [PATCH] Disable REMOVE_OLD_MODS when it interferes with managed mod/plugin features (#2648) --- scripts/start-deployAutoCF | 2 ++ scripts/start-deployModrinth | 2 ++ scripts/start-setupModpack | 8 ++++++++ scripts/start-utils | 9 +++++++++ 4 files changed, 21 insertions(+) diff --git a/scripts/start-deployAutoCF b/scripts/start-deployAutoCF index af88b696..2b3f51dc 100644 --- a/scripts/start-deployAutoCF +++ b/scripts/start-deployAutoCF @@ -24,6 +24,8 @@ resultsFile=/data/.install-curseforge.env isDebugging && set -x +ensureRemoveAllModsOff "MOD_PLATFORM=AUTO_CURSEFORGE" + args=( --results-file="$resultsFile" ) diff --git a/scripts/start-deployModrinth b/scripts/start-deployModrinth index 1a5da6bc..92708e17 100644 --- a/scripts/start-deployModrinth +++ b/scripts/start-deployModrinth @@ -19,6 +19,8 @@ fi isDebugging && set -x +ensureRemoveAllModsOff "MOD_PLATFORM=MODRINTH" + args=( --results-file="$resultsFile" --project="${MODRINTH_MODPACK}" diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index e20d73f1..644e1bc0 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -83,6 +83,9 @@ fi function handleListings() { if usesMods && usesPlugins; then if [[ "$MODS" ]]; then + + ensureRemoveAllModsOff "MODS is set" + mkdir -p "$MODS_OUT_DIR" mc-image-helper mcopy \ --glob=*.jar \ @@ -91,6 +94,7 @@ function handleListings() { "$MODS" fi if [[ "$PLUGINS" ]]; then + ensureRemoveAllModsOff "PLUGINS is set" mkdir -p "$PLUGINS_OUT_DIR" mc-image-helper mcopy \ --glob=*.jar \ @@ -100,6 +104,7 @@ function handleListings() { fi if [[ "$MODS_FILE" ]]; then + ensureRemoveAllModsOff "MODS_FILE is set" mkdir -p "$MODS_OUT_DIR" mc-image-helper mcopy \ --file-is-listing \ @@ -108,6 +113,7 @@ function handleListings() { "$MODS_FILE" fi if [[ "$PLUGINS_FILE" ]]; then + ensureRemoveAllModsOff "PLUGINS_FILE is set" mkdir -p "$PLUGINS_OUT_DIR" mc-image-helper mcopy \ --file-is-listing \ @@ -123,6 +129,7 @@ function handleListings() { fi if [[ "$MODS" || "$PLUGINS" ]]; then + ensureRemoveAllModsOff "MODS or PLUGINS is set" mkdir -p "$outDir" mc-image-helper mcopy \ --glob=*.jar \ @@ -132,6 +139,7 @@ function handleListings() { fi if [[ "$MODS_FILE" || "$PLUGINS_FILE" ]]; then + ensureRemoveAllModsOff "MODS_FILE or PLUGINS_FILE is set" mkdir -p "$outDir" mc-image-helper mcopy \ --file-is-listing \ diff --git a/scripts/start-utils b/scripts/start-utils index 0e2d55c4..ac525dfd 100755 --- a/scripts/start-utils +++ b/scripts/start-utils @@ -347,4 +347,13 @@ function resolveFamily() { ;; esac export FAMILY +} + +function ensureRemoveAllModsOff() { + reason=${1?} + + if isTrue "${REMOVE_OLD_MODS:-false}"; then + log "WARNING using REMOVE_OLDS_MODS interferes with $reason -- it is now disabled" + REMOVE_OLD_MODS=false + fi } \ No newline at end of file