Skip to content

Commit

Permalink
min, max-length project name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Jan 29, 2018
1 parent d29b50c commit 70f4d94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions commands/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,14 @@ func (t *Templating) getQuestions() []*survey.Question {
Name: "Name",
Prompt: &survey.Input{
Message: "What is the project name?",
Help: "Allowed character [^a-zA-Z0-9_-]+",
Help: "Allowed character [a-zA-Z0-9_-]{3,30}",
},
Validate: survey.ComposeValidators(survey.Required, projectNameValidator),
Validate: survey.ComposeValidators(
survey.Required,
survey.MinLength(3),
survey.MaxLength(30),
projectNameValidator,
),
},
{
Name: "Description",
Expand Down

0 comments on commit 70f4d94

Please sign in to comment.