From 23eaa6e1e42b9c2cfeb74b5cb40c29519f694713 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 27 Feb 2023 11:57:46 -0800 Subject: [PATCH] Fix codegen for older bash --- hack/update-codegen.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index ae451465b1b..2d7ece0121e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -996,7 +996,8 @@ for arg; do print_codegens exit 1 fi - codegens_to_run+=("${matches[@]}") + # The array-syntax abomination is to accommodate older bash. + codegens_to_run+=("${matches[@]:+"${matches[@]}"}") done # If no codegens were specified, run them all. @@ -1005,5 +1006,6 @@ if [[ "${#codegens_to_run[@]}" == 0 ]]; then fi for g in "${codegens_to_run[@]}"; do - "codegen::${g}" "${flags_to_pass[@]}" + # The array-syntax abomination is to accommodate older bash. + "codegen::${g}" "${flags_to_pass[@]:+"${flags_to_pass[@]}"}" done