feat: Server library cleanup on paper install (#4046)

This commit is contained in:
Harrison Black
2026-05-18 21:59:23 +10:00
committed by GitHub
parent fd823d6040
commit c95b638faa
2 changed files with 26 additions and 6 deletions
+20 -6
View File
@@ -11,17 +11,26 @@ handleDebugMode
: "${PAPER_DOWNLOAD_URL:=}"
: "${PAPER_CUSTOM_JAR:=}"
: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/Shonz1/minecraft-default-configs/main}}"
: "${CLEAN_SERVER_LIBRARIES:=true}"
resultsFile=/data/.paper.env
if [[ $PAPER_CUSTOM_JAR ]]; then
export SERVER="$PAPER_CUSTOM_JAR"
elif [[ $PAPER_DOWNLOAD_URL ]]; then
if ! mc-image-helper install-paper \
--output-directory=/data \
--results-file="$resultsFile" \
--url="$PAPER_DOWNLOAD_URL"; then
logError "Failed to download from custom PaperMC URL"
exit 1
args=(
--output-directory=/data
--results-file="$resultsFile"
--url="$PAPER_DOWNLOAD_URL"
)
if [[ $CLEAN_SERVER_LIBRARIES ]]; then
args+=(--clean-libraries)
fi
if ! mc-image-helper install-paper "${args[@]}"; then
logError "Failed to download from custom PaperMC URL"
exit 1
fi
applyResultsFile ${resultsFile}
else
@@ -35,6 +44,11 @@ else
if [[ $PAPER_BUILD ]]; then
args+=(--build="$PAPER_BUILD")
fi
if [[ $CLEAN_SERVER_LIBRARIES ]]; then
args+=(--clean-libraries)
fi
if ! mc-image-helper install-paper "${args[@]}"; then
logError "Failed to download $PAPER_PROJECT"
exit 1