mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Used json-path of image helper get
for vanilla lookup
This commit is contained in:
parent
57d9da96a1
commit
63b919f1a9
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)"
|
||||
|
Loading…
Reference in New Issue
Block a user