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/typescript/bin/cli.tsmodified+7-1
Changes to packages/typescript/bin/cli.ts
@@ -729,9 +729,15 @@ cli
729729 .example('craft init MyApp --template dashboard')
730730 .example('craft init MyApp --template all')
731731 .action(async (name: string, options?: any) => {
732 const template = options?.template || 'blank'
733 const templates = ['blank', 'tabs', 'drawer', 'dashboard', 'desktop', 'ios', 'android', 'all']
734 if (!templates.includes(template)) {
735 console.error(`Error: Unknown template "${template}"`)
736 console.error(`Available templates: ${templates.join(', ')}`)
737 process.exit(1)
738 }
732739 console.log(`\n⚡ Creating new Craft project: ${name}\n`)
733740
734 const template = options?.template || 'blank'
735741 const bundleId = options?.bundleId || `com.example.${name.toLowerCase().replace(/[^a-z0-9]/g, '')}`
736742 const appNameSlug = name.toLowerCase().replace(/[^a-z0-9]/g, '-')
737743