fix(install): prompt on /dev/tty so it works under curl|bash

stdin is the script pipe when run as `curl ... | bash`, so the -t 0
check silently skipped the domain question. Read from the controlling
terminal instead; no tty (CI/cron) still defaults to localhost.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-28 20:19:36 +02:00
1 parent ac4ca9a3ae
commit 1226d44872
2 files changed
+7 -6

No files matched your search

+6 -5
View File
@@ -57,12 +57,13 @@ else
if [ -z "$PUBLIC_URL" ]; then
DEFAULT_URL="http://localhost"
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
if [ -t 0 ]; then
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
else
PUBLIC_URL="$DEFAULT_URL"
# Under `curl | bash` stdin is the script pipe — prompt on the
# controlling terminal instead. No tty (CI/cron) → default silently.
if exec 9</dev/tty 2>/dev/null; then
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL <&9 || true
exec 9>&-
fi
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
fi
# Normalize: default scheme http, strip trailing slash.