Used json-path of image helper get for vanilla lookup

This commit is contained in:
Geoff Bourne
2021-10-11 15:53:09 -05:00
parent 57d9da96a1
commit 63b919f1a9
3 changed files with 11 additions and 5 deletions
+8 -2
View File
@@ -66,10 +66,16 @@ export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.js
case "X$VERSION" in
X|XLATEST|Xlatest)
VANILLA_VERSION=$(get "$VERSIONS_JSON" | jq -r '.latest.release')
if ! VANILLA_VERSION=$(get --json-path '$.latest.release' "$VERSIONS_JSON"); then
log "ERROR: version lookup failed: $VANILLA_VERSION"
exit 1
fi
;;
XSNAPSHOT|Xsnapshot)
VANILLA_VERSION=$(get "$VERSIONS_JSON" | jq -r '.latest.snapshot')
if ! VANILLA_VERSION=$(get --json-path '$.latest.snapshot' "$VERSIONS_JSON"); then
log "ERROR: version lookup failed: $VANILLA_VERSION"
exit 1
fi
;;
*)
VANILLA_VERSION=$VERSION