From 452d9e8c1a47cabd350b35430600dccfc0589e0c Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 21 Sep 2022 09:54:29 -0700 Subject: [PATCH] Support bash <4.4 in setup.sh --- setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 7c95d8b..44a8d4d 100755 --- a/setup.sh +++ b/setup.sh @@ -14,8 +14,11 @@ DIR="$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" SRC_DIR="$DIR/src" # read file basenames to copy_files array -readarray -d '' copy_files < <(find "$SRC_DIR" -type f -printf '%f\0') +copy_files=() files_to_remove=() +while IFS= read -r -d $'\0'; do + copy_files+=( "$(basename "$REPLY")" ) +done < <(find "$SRC_DIR" -type f -print0) if [ $remove -eq 1 ]; then for file in "${copy_files[@]}"; do