Call bootstrap scripts with a tty
Inspired by #449 but using read instead of mapfile to make it work with bash 3. Fixes #344.
This commit is contained in:
parent
3a1b236147
commit
ec10041024
1 changed files with 11 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue