From ec10041024364b39f402f6ad5a5618e0b0e10909 Mon Sep 17 00:00:00 2001 From: Erik Flodin Date: Sun, 24 Nov 2024 20:08:12 +0100 Subject: [PATCH] Call bootstrap scripts with a tty Inspired by #449 but using read instead of mapfile to make it work with bash 3. Fixes #344. --- contrib/bootstrap/bootstrap-in-dir | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/contrib/bootstrap/bootstrap-in-dir b/contrib/bootstrap/bootstrap-in-dir index 8955641..1af1943 100755 --- a/contrib/bootstrap/bootstrap-in-dir +++ b/contrib/bootstrap/bootstrap-in-dir @@ -14,11 +14,16 @@ if [[ ! -d "$BOOTSTRAP_D" ]]; then exit 1 fi -find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do - if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then - if ! "$bootstrap"; then - echo "Error: bootstrap '$bootstrap' failed" >&2 - exit 1 - fi +declare -a bootstraps +while IFS= read -r bootstrap; do + if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ ~$ ]]; then + bootstraps+=("$bootstrap") + fi +done < <(find -L "$BOOTSTRAP_D" -type f | sort) + +for bootstrap in "${bootstraps[@]}"; do + if ! "$bootstrap"; then + echo "Error: bootstrap '$bootstrap' failed" >&2 + exit 1 fi done