Skip to content

Commit 417bcda

Browse files
committed
fix: use .versions | keys | last for deterministic latest MC version
The Fill v3 API returns .versions as an object (keys = MC version strings), not an array. Using `keys | last` yields the lexicographically highest (= newest) version reliably. Fixes broken `.versions | last` (was null on object input) and the non-deterministic `keys_unsorted[0]` variant.
1 parent ac03eed commit 417bcda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

setup_minecraft_lxc.sh

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fi
4545
# ── Download latest stable PaperMC via Fill v3 API ──
4646
FILL_API="https://fill.papermc.io/v3/projects/paper"
4747

48-
LATEST_VERSION=$(curl -fsSL -H "User-Agent: ${USER_AGENT}" "${FILL_API}" | jq -r '.versions | last')
48+
LATEST_VERSION=$(curl -fsSL -H "User-Agent: ${USER_AGENT}" "${FILL_API}" | jq -r '.versions | keys | last')
4949
echo "Latest Minecraft version: ${LATEST_VERSION}"
5050

5151
BUILDS_JSON=$(curl -fsSL -H "User-Agent: ${USER_AGENT}" "${FILL_API}/versions/${LATEST_VERSION}/builds")

0 commit comments

Comments
 (0)