Skip to content

Commit

Permalink
Fail gracefully in situations where there isn't a paper build yet
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHenchman committed Jun 14, 2024
1 parent 7c8186b commit 57f785f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ function download_version() {
echo "$version_jar_sha1 $TARGET_DIR/$version/$version.jar" | shasum -a 1 -c
;;
paper)
local paper_build="$(curl "https://papermc.io/api/v2/projects/paper/versions/$version" | jq '.builds[-1]' --raw-output)"
local paper_build="$(curl "https://papermc.io/api/v2/projects/paper/versions/$version" | jq '.builds[-1] // ""' --raw-output)"
if [ -z "$paper_build" ]; then
echo "WARN: No paper build found for version $version"
exit 0
fi
local paper_download_json="$(curl "https://papermc.io/api/v2/projects/paper/versions/$version/builds/$paper_build")"
local paper_download_name="$(echo "$paper_download_json" | jq .downloads.application.name --raw-output)"
local paper_download_sha="$(echo "$paper_download_json" | jq .downloads.application.sha256 --raw-output)"
Expand Down

0 comments on commit 57f785f

Please sign in to comment.