Skip to content

feat(setup): add robust input validation for user prompts - #1

Merged
s403o merged 2 commits into
s403o:mainfrom
talaatmagdyx:patch-1
Jun 14, 2025
Merged

feat(setup): add robust input validation for user prompts#1
s403o merged 2 commits into
s403o:mainfrom
talaatmagdyx:patch-1

Conversation

@talaatmagdyx

Copy link
Copy Markdown
Contributor

Description:

This PR enhances the gitmeright setup script by introducing input validation to ensure that all required user inputs (GitHub username, full names, emails, and project names) are not left empty.

🔧 Changes Introduced:

  • Added a reusable prompt_and_validate Bash function that:

    • Prompts the user for input.
    • Loops until a non-empty response is provided.
  • Replaced all read -p prompts with the new validation wrapper to enforce required input.

  • Improved the user experience by displaying clear error messages for missing input.

✅ Benefits:

  • Prevents misconfigured .gitconfig files due to empty placeholders.
  • Reduces setup errors and manual cleanup.
  • Ensures consistent SSH key generation and Git identity setup.

🧪 Testing:

  • Ran the script locally with valid and invalid inputs to confirm validation works as expected.
  • Verified that .gitconfig files are correctly populated and no silent failures occur.

@s403o
s403o self-requested a review June 14, 2025 19:47
@s403o
s403o merged commit e02a441 into s403o:main Jun 14, 2025

@s403o s403o left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@talaatmagdyx Thanks for the contribution! I've tested the changes, and everything works as expected. Looks good to me!

@s403o s403o added the enhancement New feature or request label Jun 14, 2025
s403o added a commit that referenced this pull request Jul 30, 2026
feat(setup): add robust input validation for user prompts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants