1
0
Fork 0
mirror of synced 2024-12-04 06:35:36 -05:00

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:
Erik Flodin 2024-11-24 20:08:12 +01:00
parent 3a1b236147
commit ec10041024
No known key found for this signature in database
GPG key ID: 420A7C865EE3F85F

View file

@ -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