mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-23 04:05:26 +00:00
Retain declared version for placeholder usage (#2486)
This commit is contained in:
@@ -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.
|
: 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
|
!!! example
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ fi
|
|||||||
|
|
||||||
cd /data || exit 1
|
cd /data || exit 1
|
||||||
|
|
||||||
export ORIGINAL_TYPE=${TYPE^^}
|
export DECLARED_TYPE=${TYPE^^}
|
||||||
|
export DECLARED_VERSION="$VERSION"
|
||||||
|
|
||||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||||
"${SCRIPTS:-/}start-autopause"
|
"${SCRIPTS:-/}start-autopause"
|
||||||
|
|||||||
@@ -145,10 +145,10 @@ if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
|
|||||||
# which shows up in the server listing in the client
|
# which shows up in the server listing in the client
|
||||||
if ! [ -v MOTD ]; then
|
if ! [ -v MOTD ]; then
|
||||||
# snapshot is the odd case where we have to look at version to identify that label
|
# 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
|
label=SNAPSHOT
|
||||||
else
|
else
|
||||||
label=${ORIGINAL_TYPE}
|
label=${DECLARED_TYPE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert label to title-case
|
# Convert label to title-case
|
||||||
|
|||||||
Reference in New Issue
Block a user