Skip to content

Commit 85f2c3c

Browse files
authored
fix(lxc): use .versions | keys | last for deterministic latest PaperMC version (#72)
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` (null on object input) and the non-deterministic `keys_unsorted[0]` variant from the original PR. Co-authored-by: Justahobby01 <44276845+Justahobby01@users.noreply.github.com>
1 parent 723d22b commit 85f2c3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

setup_minecraft_lxc.sh

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' | jq -r '.[keys_unsorted[0]][0]')
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)