Skip to content

Commit 9a20ab7

Browse files
authored
Download default spigot.yml for PaperMC to top-level directory (#3216)
1 parent 6514ed8 commit 9a20ab7

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

scripts/start-deployPaper

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ else
4343
fi
4444

4545
# Download default configs to allow for consistent patching
46-
for c in paper-global.yml paper-world-defaults.yml spigot.yml; do
47-
DOWNLOAD_DEFAULT_CONFIGS+=",${PAPER_CONFIG_DEFAULTS_REPO}/${VERSION}/$c"
48-
done
46+
DOWNLOAD_DEFAULT_CONFIGS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" paper-global.yml paper-world-defaults.yml)
4947
export DOWNLOAD_DEFAULT_CONFIGS
48+
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" spigot.yml)
49+
export DOWNLOAD_DEFAULTS
5050

5151
# Normalize on Spigot for downstream operations
5252
export FAMILY=SPIGOT

scripts/start-setupEnvVariables

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
3636
logWarning "One or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
3737
fi
3838
fi
39+
if [[ $DOWNLOAD_DEFAULTS ]]; then
40+
log "Downloading default top-level configs, if needed"
41+
if ! mc-image-helper mcopy \
42+
--to /data \
43+
--skip-existing --skip-up-to-date=false \
44+
"$DOWNLOAD_DEFAULTS" 2> /dev/null; then
45+
logWarning "One or more default files were not available from $DOWNLOAD_DEFAULTS"
46+
fi
47+
fi
3948

4049
if [[ ${PATCH_DEFINITIONS} ]]; then
4150
log "Applying patch definitions from ${PATCH_DEFINITIONS}"

scripts/start-utils

+14
Original file line numberDiff line numberDiff line change
@@ -513,3 +513,17 @@ function ensureRemoveAllModsOff() {
513513
REMOVE_OLD_MODS=false
514514
fi
515515
}
516+
517+
function buildDownloadList() {
518+
repoUrl=${1?}
519+
version=${2?}
520+
shift 2
521+
result=
522+
for c in "${@}"; do
523+
if [[ $result ]]; then
524+
result+=","
525+
fi
526+
result+="${repoUrl}/${version}/$c"
527+
done
528+
echo "$result"
529+
}

0 commit comments

Comments
 (0)