Skip to content

Commit

Permalink
Call bootstrap scripts with a tty
Browse files Browse the repository at this point in the history
Inspired by #449 but using read instead of mapfile to make it work with bash 3.
  • Loading branch information
erijo committed Nov 24, 2024
1 parent 30fa6f0 commit 90a2a3c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions contrib/bootstrap/bootstrap-in-dir
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 90a2a3c

Please sign in to comment.