Skip to content

Commit

Permalink
fix: projectName validation in create-fabrice-app (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkarw authored Dec 11, 2024
1 parent 3df8cf5 commit f84d455
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/create-fabrice-ai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ intro(chalk.gray(`(c) 2024 Callstack Research Team`))

const projectName = await text({
message: 'How would you like to name your project?',
validate: (value) => {
const isValid = /^[a-zA-Z0-9-_]+$/.test(value)
return isValid
? undefined
: 'Please provide a valid project name (no spaces or special characters).'
},
})

if (typeof projectName !== 'string') {
Expand Down

0 comments on commit f84d455

Please sign in to comment.