diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/java/devcontainer-feature.json | 2 | ||||
-rw-r--r-- | src/java/install.sh | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json index 7bdec6a..d4aede8 100644 --- a/src/java/devcontainer-feature.json +++ b/src/java/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "java", - "version": "1.2.1", + "version": "1.2.2", "name": "Java (via SDKMAN!)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/java", "description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.", diff --git a/src/java/install.sh b/src/java/install.sh index ea43dd3..2decc31 100644 --- a/src/java/install.sh +++ b/src/java/install.sh @@ -111,13 +111,13 @@ sdk_install() { elif echo "${requested_version}" | grep -oE "${full_version_check}" > /dev/null 2>&1; then echo "${requested_version}" else - local regex="${prefix}\\K[0-9]+\\.[0-9]+\\.[0-9]+${suffix}" + local regex="${prefix}\\K[0-9]+\\.?[0-9]*\\.?[0-9]*${suffix}" local version_list=$(su ${USERNAME} -c ". \${SDKMAN_DIR}/bin/sdkman-init.sh && sdk list ${install_type} 2>&1 | grep -oP \"${regex}\" | tr -d ' ' | sort -rV") if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ]; then requested_version="$(echo "${version_list}" | head -n 1)" else set +e - requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" + requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|-|$)")" set -e fi if [ -z "${requested_version}" ] || ! echo "${version_list}" | grep "^${requested_version//./\\.}$" > /dev/null 2>&1; then |