Skip to content

Commit

Permalink
fix: Use project variable for API script (#309)
Browse files Browse the repository at this point in the history
Co-authored-by: phant0m2290 <[email protected]>
  • Loading branch information
Leguan16 and phant0m2290 authored Feb 25, 2024
1 parent 10b9a63 commit 0e223fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/misc/downloads-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ This will get the latest stable build for the given project and Minecraft versio
PROJECT="paper"
MINECRAFT_VERSION="%%_MAJ_MIN_MC_%%"
LATEST_VERSION=$(curl -s https://api.papermc.io/v2/projects/paper | \
LATEST_VERSION=$(curl -s https://api.papermc.io/v2/projects/${PROJECT} | \
jq -r '.versions[-1]')
LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds | \
jq -r '.builds | map(select(.channel == "default") | .build) | .[-1]')
JAR_NAME=paper-${LATEST_VERSION}-${LATEST_BUILD}.jar
JAR_NAME=${PROJECT}-${LATEST_VERSION}-${LATEST_BUILD}.jar
PAPERMC_URL="https://api.papermc.io/v2/projects/paper/versions/${LATEST_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}"
PAPERMC_URL="https://api.papermc.io/v2/projects/${PROJECT}/versions/${LATEST_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}"
# Download the latest PaperMC version
curl -o server.jar $PAPERMC_URL
Expand Down

0 comments on commit 0e223fa

Please sign in to comment.