From 0e223facdaf71612994ffc44ba1d19fb899719d4 Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Sun, 25 Feb 2024 03:01:47 +0100 Subject: [PATCH] fix: Use project variable for API script (#309) Co-authored-by: phant0m2290 --- docs/misc/downloads-api.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/misc/downloads-api.mdx b/docs/misc/downloads-api.mdx index 042af0293..e909bd54f 100644 --- a/docs/misc/downloads-api.mdx +++ b/docs/misc/downloads-api.mdx @@ -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