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:
@@ -244,18 +244,19 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get email from parameter or prompt
|
# Get email from parameter (no prompting)
|
||||||
if [ -n "$REGISTER_EMAIL" ]; then
|
if [ -n "$REGISTER_EMAIL" ]; then
|
||||||
USER_EMAIL="$REGISTER_EMAIL"
|
USER_EMAIL="$REGISTER_EMAIL"
|
||||||
echo "📧 Using email: $USER_EMAIL"
|
echo "📧 Using email: $USER_EMAIL"
|
||||||
else
|
else
|
||||||
read -p "📧 Enter your email address: " USER_EMAIL
|
echo "❌ Error: Email address is required"
|
||||||
if [ -z "$USER_EMAIL" ]; then
|
echo ""
|
||||||
echo "❌ Error: Email address is required"
|
echo "Usage:"
|
||||||
echo ""
|
echo " $0 --register --email YOUR_EMAIL"
|
||||||
echo "For non-interactive mode, use: $0 --register --email YOUR_EMAIL"
|
echo ""
|
||||||
exit 1
|
echo "Example:"
|
||||||
fi
|
echo " $0 --register --email ryan.andersson@goryan.io"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -310,21 +311,18 @@ else
|
|||||||
echo " https://mailhog.goryan.io"
|
echo " https://mailhog.goryan.io"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Use parameter if provided, otherwise prompt
|
# Use parameter if provided, otherwise exit with instructions
|
||||||
if [ -n "$VERIFY_CODE_PARAM" ]; then
|
if [ -n "$VERIFY_CODE_PARAM" ]; then
|
||||||
VERIFY_CODE="$VERIFY_CODE_PARAM"
|
VERIFY_CODE="$VERIFY_CODE_PARAM"
|
||||||
echo "🔐 Using verification code from parameter"
|
echo "🔐 Using verification code from parameter"
|
||||||
else
|
else
|
||||||
read -p "Enter the verification code from the email: " VERIFY_CODE
|
echo "❌ Verification code required"
|
||||||
if [ -z "$VERIFY_CODE" ]; then
|
echo ""
|
||||||
echo "❌ Error: Verification code is required"
|
echo "Check MailHog for your verification code, then run:"
|
||||||
echo ""
|
echo " $0 --verify-email-code YOUR_CODE"
|
||||||
echo "You can verify later by running:"
|
echo ""
|
||||||
echo " $0 --verify-email-code YOUR_CODE"
|
echo "Configuration saved to $SAAC_CONFIG_FILE"
|
||||||
echo ""
|
exit 1
|
||||||
echo "Your configuration has been saved to $SAAC_CONFIG_FILE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -368,18 +366,15 @@ if [ "$VERIFIED" != "true" ]; then
|
|||||||
echo " https://mailhog.goryan.io"
|
echo " https://mailhog.goryan.io"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Use parameter if provided, otherwise prompt
|
# Use parameter if provided, otherwise exit with instructions
|
||||||
if [ -n "$VERIFY_CODE_PARAM" ]; then
|
if [ -n "$VERIFY_CODE_PARAM" ]; then
|
||||||
VERIFY_CODE="$VERIFY_CODE_PARAM"
|
VERIFY_CODE="$VERIFY_CODE_PARAM"
|
||||||
echo "🔐 Using verification code from parameter"
|
echo "🔐 Using verification code from parameter"
|
||||||
else
|
else
|
||||||
read -p "Enter the verification code from the email: " VERIFY_CODE
|
echo "❌ Verification code required"
|
||||||
if [ -z "$VERIFY_CODE" ]; then
|
echo ""
|
||||||
echo "❌ Error: Verification code is required"
|
echo "Run with: $0 --verify-email-code YOUR_CODE"
|
||||||
echo ""
|
exit 1
|
||||||
echo "Run with: $0 --verify-email-code YOUR_CODE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user