Commit 8e728e4
fix: handle empty arrays with set -u in pattern.sh (#91)
On macOS with podman machine, PKI_HOST_MOUNT_ARGS and EXTRA_ARGS_ARRAY
can be empty arrays. When using set -u (nounset), bash throws
"unbound variable" errors when expanding empty arrays with [@].
Use conditional expansion "${array[@]+"${array[@]}"}" which expands
to nothing if the array is empty, avoiding the unbound variable error.
This fixes: ./pattern.sh: line 93: PKI_HOST_MOUNT_ARGS[@]: unbound variable
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 5fb705e commit 8e728e4
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
0 commit comments