Only initialize REPO_SOURCE_DATA if Bash supports associative arrays.
authorW. Trevor King <wking@drexel.edu>
Thu, 1 Dec 2011 14:12:34 +0000 (09:12 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 1 Dec 2011 14:12:34 +0000 (09:12 -0500)
We already bail out if the user tries to clone using wget.  This
commit just avoids pestering the user with the 'declare' error
message.

dotfiles.sh

index 6571f98e505c4a758d8c5e12263d33b09c04fbe6..acaf3c39946badc82725c9f4825a664fdfdbdf8f 100755 (executable)
@@ -114,7 +114,10 @@ function list_files()
 }
 
 # Global variable to allow passing associative arrats between functions
-declare -A REPO_SOURCE_DATA
+
+if [ "${BASH_MAJOR}" -ge 4 ]; then
+       declare -A REPO_SOURCE_DATA
+fi
 
 function set_repo_source()
 {