Replace mapfile with portable while-read loop in chat script

mapfile is a bash 4+ builtin and fails on macOS default bash 3.2
with "command not found".
This commit is contained in:
Mohamed Boudra
2026-03-26 17:51:56 +07:00
parent c1d71dfedc
commit f13178a9ad

View File

@@ -495,7 +495,10 @@ case "$command_name" in
sanitize_room_path "$room"
require_room "$room"
mapfile -t all_files < <(message_files_sorted "$room")
all_files=()
while IFS= read -r _f; do
all_files+=("$_f")
done < <(message_files_sorted "$room")
since_file=""
if [[ -n "$since" ]]; then
@@ -587,7 +590,10 @@ case "$command_name" in
trap 'exit 130' INT TERM
while true; do
mapfile -t all_files < <(message_files_sorted "$room")
all_files=()
while IFS= read -r _f; do
all_files+=("$_f")
done < <(message_files_sorted "$room")
new_files=()
after_baseline=false