feat(cli): don't validate email addresses in init command
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
parent
530e0571c9
commit
cd94dbd57f
1 changed files with 1 additions and 12 deletions
|
|
@ -596,19 +596,8 @@ impl Init {
|
|||
};
|
||||
|
||||
let email = || {
|
||||
Input::with_theme(&ColorfulTheme::default())
|
||||
Input::<String>::with_theme(&ColorfulTheme::default())
|
||||
.with_prompt("Author email")
|
||||
.validate_with({
|
||||
move |input: &String| -> Result<(), &str> {
|
||||
if (input.contains('@') && input.contains('.'))
|
||||
|| input.trim().is_empty()
|
||||
{
|
||||
Ok(())
|
||||
} else {
|
||||
Err("This is not a valid email address")
|
||||
}
|
||||
}
|
||||
})
|
||||
.allow_empty(true)
|
||||
.interact_text()
|
||||
.map(|e| (!e.trim().is_empty()).then_some(e))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue