--- /dev/null
+---
+fixes:
+ - |
+ Fix error with handling unbound arrays for search extensions, when using
+ `set -u`. The correct way of using this.
+
+ .. code-block:: bash
+
+ set -u
+ arr=()
+ echo "output: '${arr[@]}'"
+ bash: arr[@]: unbound variable
+ echo "output: '${arr[@]:-}'"
+ foo: ''
# Handle multiple search extensions as separate values to '-p|--pattern'
set -f # Disable pathname expansion
+ search_exts=()
IFS=' ' read -r -a search_exts <<< "${ARCHIVE_ARTIFACTS:-}"
pattern_opts=()
- for search_ext in "${search_exts[@]}";
+ for search_ext in "${search_exts[@]:-}";
do
pattern_opts+=("-p" "$search_ext")
done