diff --git a/gitlab/functions.sh b/gitlab/functions.sh index 1cf58aaaf4c2f3e49b45a0e6935a8825ab364484..e0b6b03d4864593add74c64757b94c83852fbf55 100644 --- a/gitlab/functions.sh +++ b/gitlab/functions.sh @@ -93,10 +93,12 @@ check_env() { # Checks a given environment variable array is set (non-zero size) +# Then prints all of its components check_array_env() { check_defined "${1}" - for i in "${!1[@]}"; do - log_info "${1}[${i}]=${!1[${i}]}"; + eval array=\( \${${1}[@]} \) + for i in "${!array[@]}"; do + log_info "${1}[${i}]=${array[${i}]}"; done }