Remove all interactive prompts - require parameters

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.
This commit is contained in:
2026-01-24 21:04:21 +01:00
parent 56b4a7f3ce
commit 494ba37212

View File

@@ -244,19 +244,20 @@ 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"
echo "Usage:"
echo " $0 --register --email YOUR_EMAIL"
echo ""
echo "Example:"
echo " $0 --register --email ryan.andersson@goryan.io"
exit 1
fi
fi
echo ""
echo "📧 Registering user: $USER_EMAIL"
@@ -310,22 +311,19 @@ 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 "❌ Verification code required"
echo ""
echo "You can verify later by running:"
echo "Check MailHog for your verification code, then run:"
echo " $0 --verify-email-code YOUR_CODE"
echo ""
echo "Your configuration has been saved to $SAAC_CONFIG_FILE"
echo "Configuration saved to $SAAC_CONFIG_FILE"
exit 1
fi
fi
echo ""
echo "🔐 Verifying email..."
@@ -368,19 +366,16 @@ 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 "❌ Verification code required"
echo ""
echo "Run with: $0 --verify-email-code YOUR_CODE"
exit 1
fi
fi
echo ""
echo "🔐 Verifying email..."