From 14de9281e29682b092f1530e3943ac9c550ec192 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 9 Feb 2024 19:01:32 -0600 Subject: [PATCH] auto-cf: add option to ignore files missing from previous installation (#2649) --- Dockerfile | 2 +- .../mod-platforms/auto-curseforge.md | 24 +++++++++++++++++++ scripts/start-deployAutoCF | 4 ++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 83c4323..da2653e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \ --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.37.12 +ARG MC_HELPER_VERSION=1.37.13 ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} # used for cache busting local copy of mc-image-helper ARG MC_HELPER_REV=1 diff --git a/docs/types-and-platforms/mod-platforms/auto-curseforge.md b/docs/types-and-platforms/mod-platforms/auto-curseforge.md index 70f60d5..5120910 100644 --- a/docs/types-and-platforms/mod-platforms/auto-curseforge.md +++ b/docs/types-and-platforms/mod-platforms/auto-curseforge.md @@ -207,12 +207,36 @@ Ant-style paths can include the following globbing/wildcard symbols: ## World/Level Data Some modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the `LEVEL` to the resulting saves directory by setting `CF_SET_LEVEL_FROM` to either: + - `WORLD_FILE` - `OVERRIDES` +## Ignore missing files + +Some mods use temporary files from the modpack and delete them when finished. Others will patch themselves and "disable" the original mod jar, such as gregtech. In order to avoid the installer from detecting the absent file(s) and re-installing, those files can be ignored by passing a comma or newline delimited list to `CF_IGNORE_MISSING_FILES`. + +!!! hint + + A warning log will indicate what files were found to be missing from the previous installation run, such as + + ``` + Re-installing due to missing files from modpack: [mods/gregtech-2.6.2-beta.jar] + ``` + +!!! example + + In a Compose file + ```yaml + environment: + CF_IGNORE_MISSING_FILES: | + mods/gregtech-2.6.2-beta.jar + ``` + + ## Extra options Other configuration available: + - `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform - `CF_OVERRIDES_SKIP_EXISTING` (default is false): if set, files in the overrides that already exist in the data directory are skipped. **NOTE** world data is always skipped, if present. - `CF_FORCE_REINSTALL_MODLOADER` (default is false): this can be set to `true` to force the modpack's declared modloader, such as Forge, to be reinstalled. This is useful if some of the modloader's files become corrupted. diff --git a/scripts/start-deployAutoCF b/scripts/start-deployAutoCF index 2b3f51d..a684621 100644 --- a/scripts/start-deployAutoCF +++ b/scripts/start-deployAutoCF @@ -11,6 +11,7 @@ set -eu : "${CF_PARALLEL_DOWNLOADS:=4}" : "${CF_FORCE_SYNCHRONIZE:=false}" : "${CF_FORCE_REINSTALL_MODLOADER:=false}" +: "${CF_IGNORE_MISSING_FILES:=}" : "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}" : "${CF_EXCLUDE_MODS:=}" : "${CF_FORCE_INCLUDE_MODS:=}" @@ -50,6 +51,9 @@ fi if [[ ${CF_OVERRIDES_EXCLUSIONS} ]]; then args+=(--overrides-exclusions="$CF_OVERRIDES_EXCLUSIONS") fi +if [[ ${CF_IGNORE_MISSING_FILES} ]]; then + args+=(--ignore-missing-files="$CF_IGNORE_MISSING_FILES") +fi args+=( --force-synchronize="$CF_FORCE_SYNCHRONIZE" --force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"