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

View File

@ -60,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.5.3
ARG MC_HELPER_VERSION=1.6.1
RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin

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

View File

@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
set -o pipefail
@ -22,7 +22,7 @@ if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
fi
debug "Found version manifest at $versionManifestUrl"
serverDownloadUrl=$(get "${versionManifestUrl}" | jq --raw-output '.downloads.server.url')
serverDownloadUrl=$(get --json-path '$.downloads.server.url' "${versionManifestUrl}")
result=$?
if [ $result != 0 ]; then
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"