Skip to content

Commit

Permalink
Validate project name
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Jul 28, 2023
1 parent c55f151 commit e6db8be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ protected function interact(InputInterface $input, OutputInterface $output)
label: 'What is the name of your project?',
placeholder: 'E.g. example-app',
required: 'The project name is required.',
validate: fn ($value) => preg_match('/[^\pL\pN\-_.]/', $value) !== 0
? 'The name may only contain letters, numbers, dashes, underscores, and periods.'
: null,
));
}

Expand Down

0 comments on commit e6db8be

Please sign in to comment.