We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac302a7 commit 17700b7Copy full SHA for 17700b7
packages/create-vite/src/index.ts
@@ -363,9 +363,14 @@ async function init() {
363
message: 'Project name:',
364
defaultValue: defaultTargetDir,
365
placeholder: defaultTargetDir,
366
+ validate: (value) => {
367
+ return value.length === 0 || formatTargetDir(value).length > 0
368
+ ? undefined
369
+ : 'Invalid project name'
370
+ },
371
})
372
if (prompts.isCancel(projectName)) return cancel()
- targetDir = formatTargetDir(projectName as string) || defaultTargetDir
373
+ targetDir = formatTargetDir(projectName)
374
}
375
376
// 2. Handle directory if exist and not empty
0 commit comments