fix(install): read from /dev/tty so curl | bash confirmation prompt works, bump v0.5.2

set -euo pipefail causes the script to exit when read gets EOF from
the curl pipe instead of an interactive terminal. Fix by appending
'< /dev/tty || CONFIRM=Y' so the prompt reads from the actual terminal
regardless of how the script was invoked.
This commit is contained in:
NixReaper
2026-04-12 04:39:14 -05:00
parent da55367039
commit 3902935f60
4 changed files with 12 additions and 3 deletions
+3 -1
View File
@@ -82,6 +82,8 @@ if [[ -z "$ADMIN_EMAIL" ]]; then
ADMIN_EMAIL="admin@$(hostname -f 2>/dev/null || echo localhost)"
fi
# Redirect all interactive reads to /dev/tty so curl | bash works correctly
MARIADB_ROOT_PASS=$(openssl rand -base64 24 | tr -dc 'a-zA-Z0-9' | head -c 24)
JWT_SECRET=$(gen_secret)
JWT_REFRESH_SECRET=$(gen_secret)
@@ -93,7 +95,7 @@ echo " Admin username : $ADMIN_USER"
echo " Admin email : $ADMIN_EMAIL"
echo " Admin password : $([ "$GENERATED_PASS" = "true" ] && echo "<auto-generated>" || echo "$ADMIN_PASS")"
echo ""
read -r -p "Continue? [Y/n] " CONFIRM
read -r -p "Continue? [Y/n] " CONFIRM < /dev/tty || CONFIRM="Y"
CONFIRM="${CONFIRM:-Y}"
[[ "$CONFIRM" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 0; }