Last active
June 21, 2021 01:27
-
-
Save mja00/db973c29a9938b13d492e8ab8b496c42 to your computer and use it in GitHub Desktop.
Download latest Paper build on v2 api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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