ReviewOS

also looking at this

craft-native/craft

fix(cli): validate scaffold templates before creating projects

#298
Merged glennmichael123 wants to merge codex/scaffold-template-validation into main
4 files +53 -7
packages/create-craft/bin/cli.tsmodified+5-5
Changes to packages/create-craft/bin/cli.ts
@@ -66,6 +66,11 @@ cli
6666 }
6767
6868 const template = options?.template || 'minimal'
69 if (!['minimal', 'full-featured', 'todo-app'].includes(template)) {
70 console.error(`Error: Unknown template "${template}"`)
71 console.error('Available templates: minimal, full-featured, todo-app')
72 process.exit(1)
73 }
6974 const skipInstall = options?.skipInstall || false
7075
7176 console.log(`\n✨ Creating a new Craft app: ${projectName}`)
@@ -92,11 +97,6 @@ cli
9297 else if (template === 'todo-app') {
9398 createTodoAppTemplate(projectPath, projectName)
9499 }
95 else {
96 console.error(`Error: Unknown template "${template}"`)
97 console.log('\nAvailable templates: minimal, full-featured, todo-app')
98 process.exit(1)
99 }
100100
101101 // Install dependencies unless skipped
102102 if (!skipInstall) {