Download default spigot.yml for PaperMC to top-level directory (#3216)

This commit is contained in:
Geoff Bourne 2024-12-30 19:02:43 -06:00 committed by GitHub
parent 6514ed85a0
commit 9a20ab7b48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View file

@ -43,10 +43,10 @@ else
fi
# Download default configs to allow for consistent patching
for c in paper-global.yml paper-world-defaults.yml spigot.yml; do
DOWNLOAD_DEFAULT_CONFIGS+=",${PAPER_CONFIG_DEFAULTS_REPO}/${VERSION}/$c"
done
DOWNLOAD_DEFAULT_CONFIGS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" paper-global.yml paper-world-defaults.yml)
export DOWNLOAD_DEFAULT_CONFIGS
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" spigot.yml)
export DOWNLOAD_DEFAULTS
# Normalize on Spigot for downstream operations
export FAMILY=SPIGOT

View file

@ -36,6 +36,15 @@ if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
logWarning "One or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
fi
fi
if [[ $DOWNLOAD_DEFAULTS ]]; then
log "Downloading default top-level configs, if needed"
if ! mc-image-helper mcopy \
--to /data \
--skip-existing --skip-up-to-date=false \
"$DOWNLOAD_DEFAULTS" 2> /dev/null; then
logWarning "One or more default files were not available from $DOWNLOAD_DEFAULTS"
fi
fi
if [[ ${PATCH_DEFINITIONS} ]]; then
log "Applying patch definitions from ${PATCH_DEFINITIONS}"

View file

@ -513,3 +513,17 @@ function ensureRemoveAllModsOff() {
REMOVE_OLD_MODS=false
fi
}
function buildDownloadList() {
repoUrl=${1?}
version=${2?}
shift 2
result=
for c in "${@}"; do
if [[ $result ]]; then
result+=","
fi
result+="${repoUrl}/${version}/$c"
done
echo "$result"
}