From 494ba37212738ae46f5d5a0b3ea40995327be798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20West=C3=B6=C3=B6?= Date: Sat, 24 Jan 2026 21:04:21 +0100 Subject: [PATCH] Remove all interactive prompts - require parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed from interactive prompts to mandatory parameters for automation. Before: Prompted for email and verification code After: Exit with clear error showing required parameters Examples: ❌ ./deploy.sh Error: Email address is required Usage: ./deploy.sh --register --email YOUR_EMAIL ✅ ./deploy.sh --register --email ryan@example.com Registration successful, now run: ./deploy.sh --verify-email-code 123456 No stdin reads - fully non-interactive for LLM/automation. --- deploy-to-apps.example.sh | 49 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/deploy-to-apps.example.sh b/deploy-to-apps.example.sh index e6e42ac..b95984d 100644 --- a/deploy-to-apps.example.sh +++ b/deploy-to-apps.example.sh @@ -244,18 +244,19 @@ else fi fi - # Get email from parameter or prompt + # Get email from parameter (no prompting) if [ -n "$REGISTER_EMAIL" ]; then USER_EMAIL="$REGISTER_EMAIL" echo "📧 Using email: $USER_EMAIL" else - read -p "📧 Enter your email address: " USER_EMAIL - if [ -z "$USER_EMAIL" ]; then - echo "❌ Error: Email address is required" - echo "" - echo "For non-interactive mode, use: $0 --register --email YOUR_EMAIL" - exit 1 - fi + echo "❌ Error: Email address is required" + echo "" + echo "Usage:" + echo " $0 --register --email YOUR_EMAIL" + echo "" + echo "Example:" + echo " $0 --register --email ryan.andersson@goryan.io" + exit 1 fi echo "" @@ -310,21 +311,18 @@ else echo " https://mailhog.goryan.io" echo "" - # Use parameter if provided, otherwise prompt + # Use parameter if provided, otherwise exit with instructions if [ -n "$VERIFY_CODE_PARAM" ]; then VERIFY_CODE="$VERIFY_CODE_PARAM" echo "🔐 Using verification code from parameter" else - read -p "Enter the verification code from the email: " VERIFY_CODE - if [ -z "$VERIFY_CODE" ]; then - echo "❌ Error: Verification code is required" - echo "" - echo "You can verify later by running:" - echo " $0 --verify-email-code YOUR_CODE" - echo "" - echo "Your configuration has been saved to $SAAC_CONFIG_FILE" - exit 1 - fi + echo "❌ Verification code required" + echo "" + echo "Check MailHog for your verification code, then run:" + echo " $0 --verify-email-code YOUR_CODE" + echo "" + echo "Configuration saved to $SAAC_CONFIG_FILE" + exit 1 fi echo "" @@ -368,18 +366,15 @@ if [ "$VERIFIED" != "true" ]; then echo " https://mailhog.goryan.io" echo "" - # Use parameter if provided, otherwise prompt + # Use parameter if provided, otherwise exit with instructions if [ -n "$VERIFY_CODE_PARAM" ]; then VERIFY_CODE="$VERIFY_CODE_PARAM" echo "🔐 Using verification code from parameter" else - read -p "Enter the verification code from the email: " VERIFY_CODE - if [ -z "$VERIFY_CODE" ]; then - echo "❌ Error: Verification code is required" - echo "" - echo "Run with: $0 --verify-email-code YOUR_CODE" - exit 1 - fi + echo "❌ Verification code required" + echo "" + echo "Run with: $0 --verify-email-code YOUR_CODE" + exit 1 fi echo ""