diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 92a4d7d..c8f6ccb 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -23,8 +23,7 @@ function replace_version_in_url() { function lookupVersion() { platform=${1:?Missing required platform indicator} - # TODO need to find out API call to lookup custom version - # customVersion=${2:-} + customVersion=${2:-} DOWNLOAD_URL=$( curl -fsSL "${getUrlPage}" | @@ -48,6 +47,11 @@ function lookupVersion() { ' ) + if [[ -n "${customVersion}" && -n "${DOWNLOAD_URL}" ]]; then + DOWNLOAD_URL=$(replace_version_in_url "${DOWNLOAD_URL}" "${customVersion}") + return + fi + # shellcheck disable=SC2012 if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then VERSION=${BASH_REMATCH[1]}