Skip to content

Commit

Permalink
Download default spigot.yml for PaperMC to top-level directory (#3216)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Dec 31, 2024
1 parent 6514ed8 commit 9a20ab7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/start-deployPaper
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions scripts/start-setupEnvVariables
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
14 changes: 14 additions & 0 deletions scripts/start-utils
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 9a20ab7

Please sign in to comment.