Skip to content

Commit

Permalink
fix(nuxi): validations for --template flag (nuxt#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Oct 24, 2021
1 parent bd01031 commit 110b2b2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/nuxi/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@ const knownTemplates = {
}

const resolveTemplate = (template) => {
if (!template) {
return knownTemplates.nuxt3
}

if (typeof template === 'boolean') {
consola.error('Please specify a template')
process.exit(1)
}

if (template in knownTemplates) {
return knownTemplates[template]
}

if (typeof template === 'string' && template.includes('/')) {
if (template.includes('/')) {
return template
}

Expand Down

0 comments on commit 110b2b2

Please sign in to comment.