mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(nuxi): validations for --template
flag (#1412)
This commit is contained in:
parent
bd010313db
commit
110b2b2680
@ -14,11 +14,20 @@ const knownTemplates = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resolveTemplate = (template) => {
|
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) {
|
if (template in knownTemplates) {
|
||||||
return knownTemplates[template]
|
return knownTemplates[template]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof template === 'string' && template.includes('/')) {
|
if (template.includes('/')) {
|
||||||
return template
|
return template
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user