2023-01-09 01:15:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# shellcheck source=start-utils
|
|
|
|
. "${SCRIPTS:-/}start-utils"
|
|
|
|
|
|
|
|
: "${CF_PAGE_URL:=}"
|
|
|
|
: "${CF_SLUG:=}"
|
|
|
|
: "${CF_FILE_ID:=}"
|
|
|
|
: "${CF_FILENAME_MATCHER:=}"
|
2023-01-13 00:59:12 +00:00
|
|
|
: "${CF_PARALLEL_DOWNLOADS:=4}"
|
|
|
|
: "${CF_FORCE_SYNCHRONIZE:=false}"
|
2024-02-05 00:57:04 +00:00
|
|
|
: "${CF_FORCE_REINSTALL_MODLOADER:=false}"
|
2024-02-10 01:01:32 +00:00
|
|
|
: "${CF_IGNORE_MISSING_FILES:=}"
|
2024-07-07 03:59:23 +00:00
|
|
|
: "${CF_EXCLUDE_INCLUDE_FILE=/image/cf-exclude-include.json}"
|
2023-01-14 18:52:35 +00:00
|
|
|
: "${CF_EXCLUDE_MODS:=}"
|
|
|
|
: "${CF_FORCE_INCLUDE_MODS:=}"
|
2023-01-26 19:46:48 +00:00
|
|
|
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
|
|
|
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
|
2023-10-27 02:05:53 +00:00
|
|
|
: "${CF_OVERRIDES_EXCLUSIONS:=}" # --overrides-exclusions
|
2023-04-30 01:30:59 +00:00
|
|
|
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
|
2023-05-01 02:25:07 +00:00
|
|
|
: "${CF_MODPACK_MANIFEST:=}"
|
2024-10-15 12:54:30 +00:00
|
|
|
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
|
2023-01-09 01:15:24 +00:00
|
|
|
|
|
|
|
resultsFile=/data/.install-curseforge.env
|
|
|
|
|
|
|
|
isDebugging && set -x
|
|
|
|
|
2024-10-24 12:12:13 +00:00
|
|
|
ensureRemoveAllModsOff "MODPACK_PLATFORM=AUTO_CURSEFORGE"
|
2024-02-09 12:59:05 +00:00
|
|
|
|
2023-01-09 01:15:24 +00:00
|
|
|
args=(
|
|
|
|
--results-file="$resultsFile"
|
2023-01-13 00:59:12 +00:00
|
|
|
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
|
2024-02-05 00:57:04 +00:00
|
|
|
--force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"
|
2023-01-26 19:46:48 +00:00
|
|
|
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
2023-01-13 00:59:12 +00:00
|
|
|
)
|
2024-10-15 12:54:30 +00:00
|
|
|
setArg() {
|
|
|
|
arg="${1?}"
|
|
|
|
var="${2?}"
|
2023-01-09 01:15:24 +00:00
|
|
|
|
2024-10-15 12:54:30 +00:00
|
|
|
if [[ ${!var} ]]; then
|
|
|
|
args+=("${arg}=${!var}")
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
setArg --modpack-page-url CF_PAGE_URL
|
|
|
|
setArg --file-id CF_FILE_ID
|
|
|
|
setArg --slug CF_SLUG
|
|
|
|
setArg --modpack-manifest CF_MODPACK_MANIFEST
|
|
|
|
setArg --filename-matcher CF_FILENAME_MATCHER
|
|
|
|
setArg --set-level-from CF_SET_LEVEL_FROM
|
|
|
|
setArg --overrides-exclusions CF_OVERRIDES_EXCLUSIONS
|
|
|
|
setArg --ignore-missing-files CF_IGNORE_MISSING_FILES
|
|
|
|
setArg --api-cache-default-ttl CF_API_CACHE_DEFAULT_TTL
|
|
|
|
setArg --exclude-mods CF_EXCLUDE_MODS
|
|
|
|
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
|
|
|
|
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
|
|
|
|
setArg --downloads-repo CF_DOWNLOADS_REPO
|
2023-01-13 02:37:20 +00:00
|
|
|
|
2023-01-09 01:15:24 +00:00
|
|
|
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
2024-10-22 21:04:38 +00:00
|
|
|
logError "Failed to auto-install CurseForge modpack"
|
2023-01-09 01:15:24 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-22 21:04:38 +00:00
|
|
|
applyResultsFile ${resultsFile}
|
2023-06-17 18:00:22 +00:00
|
|
|
resolveFamily
|
2023-01-09 01:15:24 +00:00
|
|
|
|
|
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|