From 02e2c2687d34139552aafd3b0acfce82a34aecaa Mon Sep 17 00:00:00 2001 From: Ada Date: Mon, 6 Apr 2026 10:25:16 -0400 Subject: [PATCH] =?UTF-8?q?setup.sh:=20fix=20read=20for=20piped=20mode=20?= =?UTF-8?q?=E2=80=94=20detect=20non-interactive=20and=20skip=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/setup.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/deploy/setup.sh b/deploy/setup.sh index 34fc454..260cc79 100755 --- a/deploy/setup.sh +++ b/deploy/setup.sh @@ -34,6 +34,12 @@ if ! command -v curl &> /dev/null; then exit 1 fi +# Detect interactive vs piped mode +INTERACTIVE=true +if [ ! -t 0 ]; then + INTERACTIVE=false +fi + # Check for Docker DOCKER_INSTALLED=false if command -v docker &> /dev/null; then @@ -68,13 +74,19 @@ echo "Data: SQLite database is stored in a Docker named volume." echo " Use 'docker compose down -v' to DELETE the database." echo "" -# Confirm -echo -n "Continue? [Y/n]: " -read -r CONFIRM -CONFIRM=${CONFIRM:-Y} -if [ "$CONFIRM" != "Y" ] && [ "$CONFIRM" != "y" ]; then - echo "Aborted." - exit 0 +# Confirm (skip in non-interactive/piped mode) +if [ "$INTERACTIVE" = "true" ]; then + echo -n "Continue? [Y/n]: " + read -r CONFIRM + CONFIRM=${CONFIRM:-Y} + if [ "$CONFIRM" != "Y" ] && [ "$CONFIRM" != "y" ]; then + echo "Aborted." + exit 0 + fi +else + echo "(Running in non-interactive mode — proceeding automatically)" + echo "To interactively confirm, run: curl -sL ... | bash" + echo "" fi echo ""