diff options
author | Pablo Ulloa <pablo.ulloac@usach.cl> | 2023-09-27 19:26:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 19:26:53 +0300 |
commit | 9852ca8888b613daff741b3f26fd7d3b0387b42d (patch) | |
tree | 9ce1ebf2899b55a7637db1f7a3fbd036925b9350 /src/java/install.sh | |
parent | 3a22c419403b5c099c71a74c7079cde813e269d8 (diff) |
[java] fix version regex to support graalce jdk 21 (#701)feature_java_1.2.2
* [java] fixed feature test scenario check
* [java] support for non conentional version
* Update src/java/install.sh to not include whitespaces
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
* bumped patch version
---------
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
Diffstat (limited to 'src/java/install.sh')
-rw-r--r-- | src/java/install.sh | 4 |
1 files changed, 2 insertions, 2 deletions
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 |