Skip to content

Commit d2efa81

Browse files
committed
fix: macOS bash lacks associative arrays
1 parent d0aee9a commit d2efa81

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

‎build-coatjava.sh‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ runUnitTests=false
1515
installClara=false
1616
downloadData=false
1717
auxRetrieval=lfs
18-
declare -A auxDownload
19-
auxDownload['maps']=true
20-
auxDownload['nets']=true
21-
auxDownload['sqlites']=true
18+
auxDownloadMaps=true
19+
auxDownloadNets=true
20+
auxDownloadSqlites=true
2221

2322
################################################################################
2423
# usage
@@ -81,13 +80,13 @@ do
8180
--https) auxRetrieval=https ;;
8281
--wipe) auxRetrieval=wipe ;;
8382
--no-aux|--noaux)
84-
for key in "${!auxDownload[@]}"; do
85-
auxDownload[$key]=false
86-
done
83+
auxDownloadMaps=false
84+
auxDownloadNets=false
85+
auxDownloadSqlites=false
8786
;;
88-
--no-maps|--nomaps) auxDownload['maps']=false ;;
89-
--no-nets|--nonets) auxDownload['nets']=false ;;
90-
--no-sqlites|--nosqlites) auxDownload['sqlites']=false ;;
87+
--no-maps|--nomaps) auxDownloadMaps=false ;;
88+
--no-nets|--nonets) auxDownloadNets=false ;;
89+
--no-sqlites|--nosqlites) auxDownloadSqlites=false ;;
9190
--spotbugs) runSpotBugs=true ;;
9291
-n) runSpotBugs=false ;;
9392
--unittests) runUnitTests=true ;;
@@ -116,9 +115,9 @@ print_arg "runUnitTests" "$runUnitTests"
116115
print_arg "installClara" "$installClara"
117116
print_arg "downloadData" "$downloadData"
118117
print_arg "auxRetrieval" "$auxRetrieval"
119-
for key in "${!auxDownload[@]}"; do
120-
print_arg "auxDownload[$key]" "${auxDownload[$key]}"
121-
done
118+
print_arg "auxDownloadMaps" "$auxDownloadMaps"
119+
print_arg "auxDownloadNets" "$auxDownloadNets"
120+
print_arg "auxDownloadSqlites" "$auxDownloadSqlites"
122121
print_arg "mvnArgs" "${mvnArgs[@]:-}"
123122
print_arg "wgetArgs" "${wgetArgs[@]:-}"
124123
echo "-------------------------------------------------------"
@@ -256,7 +255,7 @@ download_map () {
256255

257256
# download the default field maps, as defined in libexec/env.sh:
258257
# (and duplicated in etc/services/reconstruction.yaml):
259-
if ${auxDownload['maps']}; then
258+
if $auxDownloadMaps; then
260259
case $auxRetrieval in
261260
lfs)
262261
notify_retrieval 'field maps' 'lfs'
@@ -289,7 +288,7 @@ if ${auxDownload['maps']}; then
289288
fi
290289

291290
# download neural networks
292-
if ${auxDownload['nets']}; then
291+
if $auxDownloadNets; then
293292
case $auxRetrieval in
294293
lfs)
295294
notify_retrieval 'neural networks' 'lfs'
@@ -307,7 +306,7 @@ if ${auxDownload['nets']}; then
307306
fi
308307

309308
# download neural networks
310-
if ${auxDownload['sqlites']}; then
309+
if $auxDownloadSqlites; then
311310
case $auxRetrieval in
312311
lfs)
313312
notify_retrieval 'ccdb/rcdb SQLite files' 'lfs'

0 commit comments

Comments
 (0)