From f513c670ab97792623ee5cc14361a0cf1e92b90a Mon Sep 17 00:00:00 2001 From: Jeffrey Falgout Date: Tue, 7 Mar 2023 21:16:36 -0700 Subject: [PATCH 1/2] Call bootstrap scripts with a tty. The exising bootstrip-in-dir script is changing stdin to be the result of the find command. fix #344 --- contrib/bootstrap/bootstrap-in-dir | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/bootstrap/bootstrap-in-dir b/contrib/bootstrap/bootstrap-in-dir index 8955641..d507ec1 100755 --- a/contrib/bootstrap/bootstrap-in-dir +++ b/contrib/bootstrap/bootstrap-in-dir @@ -14,7 +14,10 @@ if [[ ! -d "$BOOTSTRAP_D" ]]; then exit 1 fi -find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do +IFS=$'\n' +bootstraps=( $(find -L "$BOOTSTRAP_D" -type f | sort) ) +unset IFS +for bootstrap in "${bootstraps[@]}"; do if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then if ! "$bootstrap"; then echo "Error: bootstrap '$bootstrap' failed" >&2 From d149146da721920962f77bc2fcd5653d1625d68c Mon Sep 17 00:00:00 2001 From: Jeffrey Falgout Date: Sun, 11 Jun 2023 11:26:10 -0600 Subject: [PATCH 2/2] Switch to mapfile instead of the default word splitting + glob expansion. --- contrib/bootstrap/bootstrap-in-dir | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/bootstrap/bootstrap-in-dir b/contrib/bootstrap/bootstrap-in-dir index d507ec1..60c59c6 100755 --- a/contrib/bootstrap/bootstrap-in-dir +++ b/contrib/bootstrap/bootstrap-in-dir @@ -14,9 +14,7 @@ if [[ ! -d "$BOOTSTRAP_D" ]]; then exit 1 fi -IFS=$'\n' -bootstraps=( $(find -L "$BOOTSTRAP_D" -type f | sort) ) -unset IFS +mapfile -t bootstraps < <(find -L "$BOOTSTRAP_D" -type f | sort) for bootstrap in "${bootstraps[@]}"; do if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then if ! "$bootstrap"; then