From 4f414802e4af82941172b60a8ee5d7e4fa08ab76 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 16 Jul 2019 22:07:13 -0500 Subject: [PATCH] Bugfix: variables not being stored in array Do not directly use string in bash array arguments. More recent versions of bash do not handle this as expected. Move explicit string to a variable and then use that variable to access the array. --- build/scripts/generate.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/scripts/generate.sh b/build/scripts/generate.sh index 660494d..5b40aea 100644 --- a/build/scripts/generate.sh +++ b/build/scripts/generate.sh @@ -206,6 +206,7 @@ generate_id(){ generate_load_settings(){ local failure= local i= + local key= if [[ $settings_file == "" ]] ; then echo -e "${c_error}ERROR: no settings file has been defined.$c_reset" @@ -225,8 +226,9 @@ generate_load_settings(){ done if [[ $project_name == "" ]] ; then - if [[ $variables['project_name'] != "" ]] ; then - project_built="-${variables['project_name']}" + key="project_name" + if [[ ${variables[$key]} != "" ]] ; then + project_built="-${variables[$key]}" fi fi } -- 1.8.3.1