Skip to content

Instantly share code, notes, and snippets.

@mja00
Last active June 21, 2021 01:27
Show Gist options
  • Save mja00/db973c29a9938b13d492e8ab8b496c42 to your computer and use it in GitHub Desktop.
Save mja00/db973c29a9938b13d492e8ab8b496c42 to your computer and use it in GitHub Desktop.
Download latest Paper build on v2 api
latestVersion=$(curl -X GET "https://papermc.io/api/v2/projects/paper" -H "accept: application/json" --silent | jq '.versions[-1]' | sed 's/"//g'); versionURL=$(echo "" | awk -v latestVersion="$latestVersion" '{print $1"https://papermc.io/api/v2/projects/paper/versions/"latestVersion}'); buildnumber=$(curl -X GET $versionURL -H "accept: application/json" --silent | jq '.builds[-1]'); buildurl=$(curl -X GET "https://papermc.io/api/v2/projects/paper/versions/${latestVersion}/builds/${buildnumber}" -H "accept: application/json" --silent | jq '.downloads.application.name' | sed 's/"//g' | awk -v buildnumber="$buildnumber" -v latestVersion="$latestVersion" '{print "https://papermc.io/api/v2/projects/paper/versions/"latestVersion"/builds/"buildnumber"/downloads/"$1}'); curl -JO $buildurl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment