diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index ac40ccaa..cb594f0b 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -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 diff --git a/scripts/start-setupEnvVariables b/scripts/start-setupEnvVariables index be6d6343..38518170 100755 --- a/scripts/start-setupEnvVariables +++ b/scripts/start-setupEnvVariables @@ -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}" diff --git a/scripts/start-utils b/scripts/start-utils index 003355ff..a8f27016 100755 --- a/scripts/start-utils +++ b/scripts/start-utils @@ -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" +} \ No newline at end of file