Add VERSION_FROM_MODRINTH_PROJECTS (#3580)

This commit is contained in:
Geoff Bourne
2025-08-02 19:01:49 -05:00
committed by GitHub
parent 02640e5414
commit c2071e5038
4 changed files with 45 additions and 1 deletions

View File

@@ -139,6 +139,15 @@ cd /data || exit 1
export DECLARED_TYPE=${TYPE^^}
export DECLARED_VERSION="$VERSION"
if isTrue "${VERSION_FROM_MODRINTH_PROJECTS:-}" && [[ ${MODRINTH_PROJECTS:-} ]]; then
if ! VERSION=$(mc-image-helper version-from-modrinth-projects --projects "${MODRINTH_PROJECTS}"); then
logError "failed to resolve version from MODRINTH_PROJECTS: ${MODRINTH_PROJECTS}"
exit 1
fi
log "Resolved Minecraft version $VERSION from Modrinth projects"
export VERSION
fi
if isTrue "${ENABLE_AUTOPAUSE}"; then
"${SCRIPTS:-/}start-autopause"
fi