You've already forked Atomcms-edit
fix: move interactive prompt before unbuffer exec so read works
This commit is contained in:
+11
-6
@@ -11,6 +11,17 @@ if [ -f "$SCRIPT_DIR/.env" ]; then
|
||||
set +a
|
||||
fi
|
||||
|
||||
# Prompt for site URL before unbuffer exec, so interactive input works
|
||||
if [ -z "${NITRO_SITE_URL:-}" ]; then
|
||||
read -r -p "Enter your site URL (e.g. https://example.com): " NITRO_SITE_URL
|
||||
NITRO_SITE_URL="${NITRO_SITE_URL%/}"
|
||||
if [ -z "$NITRO_SITE_URL" ]; then
|
||||
echo "=== ❌ NITRO_SITE_URL is required. Set it in .env or enter it now. ==="
|
||||
exit 1
|
||||
fi
|
||||
export NITRO_SITE_URL
|
||||
fi
|
||||
|
||||
# Real-time output via pseudo-terminal (unbuffer from expect)
|
||||
if [ -z "${_UNBUFFERED:-}" ] && command -v unbuffer &> /dev/null; then
|
||||
export _UNBUFFERED=1
|
||||
@@ -42,12 +53,6 @@ NITRO_CLIENT="${NITRO_CLIENT_SRC:-/var/www/Nitro-V3}"
|
||||
NITRO_RENDERER="${NITRO_RENDERER_SRC:-/var/www/Nitro_Render_V3}"
|
||||
NITRO_BRANCH="${NITRO_BRANCH:-main}"
|
||||
|
||||
# Prompt for site URL if not set, so it works on any VPS
|
||||
while [ -z "${NITRO_SITE_URL:-}" ]; do
|
||||
read -r -p "Enter your site URL (e.g. https://example.com): " NITRO_SITE_URL
|
||||
NITRO_SITE_URL="${NITRO_SITE_URL%/}"
|
||||
done
|
||||
|
||||
# Derive ws/wss protocol from the site scheme
|
||||
case "$NITRO_SITE_URL" in
|
||||
https://*) NITRO_WS_PROTO="wss://" ; NITRO_DOMAIN="${NITRO_SITE_URL#https://}" ;;
|
||||
|
||||
Reference in New Issue
Block a user