mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Retain declared version for placeholder usage (#2486)
This commit is contained in:
parent
37a5d50f70
commit
85a957fe6f
@ -22,7 +22,7 @@ The following options are available for placeholders:
|
||||
|
||||
: The `FMT` string is processed by [Java's DateTimeFormatter](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html) and the current date/time is formatted.
|
||||
|
||||
Any declared or resolved environment variable may be referenced, such as `VERSION` and `TYPE`. Additionally, [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md) and [Auto CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md) modpacks will expose the environment variables `MODPACK_NAME` and `MODPACK_VERSION`.
|
||||
Any declared or resolved environment variable may be referenced, such as `VERSION` and `TYPE`. Additionally, [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md) and [Auto CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md) modpacks will expose the environment variables `MODPACK_NAME` and `MODPACK_VERSION`. The originally declared version, such as "LATEST" or "SNAPSHOT", is available in the variable `DECLARED_VERSION`
|
||||
|
||||
!!! example
|
||||
|
||||
|
@ -113,7 +113,8 @@ fi
|
||||
|
||||
cd /data || exit 1
|
||||
|
||||
export ORIGINAL_TYPE=${TYPE^^}
|
||||
export DECLARED_TYPE=${TYPE^^}
|
||||
export DECLARED_VERSION="$VERSION"
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
"${SCRIPTS:-/}start-autopause"
|
||||
|
@ -145,10 +145,10 @@ if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
|
||||
# which shows up in the server listing in the client
|
||||
if ! [ -v MOTD ]; then
|
||||
# snapshot is the odd case where we have to look at version to identify that label
|
||||
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
if [[ ${DECLARED_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
label=SNAPSHOT
|
||||
else
|
||||
label=${ORIGINAL_TYPE}
|
||||
label=${DECLARED_TYPE}
|
||||
fi
|
||||
|
||||
# Convert label to title-case
|
||||
|
Loading…
Reference in New Issue
Block a user