From 274eca5c51cab8dffc3b86b620dba32e84a3dd90 Mon Sep 17 00:00:00 2001 From: Thibault Maekelbergh <6213695+thibmaek@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:39:23 +0100 Subject: [PATCH 1/2] Add guard against Bash versions lower than 5 --- bin/functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/functions b/bin/functions index 9cd605c5..b01a0703 100755 --- a/bin/functions +++ b/bin/functions @@ -3,6 +3,11 @@ source "${ASDF_DIR:-$HOME/.asdf}/lib/utils.bash" CACHE_DIR="${TMPDIR:-/tmp}/asdf-java.cache" +if [ ! "${BASH_VERSINFO:-0}" -ge 5 ]; then + echo "Bash 5 or higher is required for asdf-java" + exit 1 +fi + if [ ! -d "${CACHE_DIR}" ] then mkdir -p "${CACHE_DIR}" From a1bd1d7bb742ddd3a24e289c623c8c054bef461d Mon Sep 17 00:00:00 2001 From: Thibault Maekelbergh <6213695+thibmaek@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:43:50 +0100 Subject: [PATCH 2/2] Add link to reqs --- bin/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/functions b/bin/functions index b01a0703..35c61eec 100755 --- a/bin/functions +++ b/bin/functions @@ -4,7 +4,8 @@ source "${ASDF_DIR:-$HOME/.asdf}/lib/utils.bash" CACHE_DIR="${TMPDIR:-/tmp}/asdf-java.cache" if [ ! "${BASH_VERSINFO:-0}" -ge 5 ]; then - echo "Bash 5 or higher is required for asdf-java" + echo "Bash 5 or higher is required for asdf-java." + echo "Please refer to the requirements for more info: https://github.com/halcyon/asdf-java#requirements" exit 1 fi