mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #8
This commit is contained in:
parent
92e7d9230f
commit
5d85dd2e4f
@ -275,13 +275,13 @@ function scanTagsDir(tagsConfigPath, tagsConfigDirname, dir, taglib) {
|
|||||||
if (fs.existsSync(tagFile)) {
|
if (fs.existsSync(tagFile)) {
|
||||||
// marko-tag.json exists in the directory, use that as the tag definition
|
// marko-tag.json exists in the directory, use that as the tag definition
|
||||||
tagDef = JSON.parse(fs.readFileSync(tagFile, {encoding: 'utf8'}));
|
tagDef = JSON.parse(fs.readFileSync(tagFile, {encoding: 'utf8'}));
|
||||||
if (!tagDef.renderer || !tagDef.template) {
|
if (!tagDef.renderer && !tagDef.template) {
|
||||||
if (fs.existsSync(rendererFile)) {
|
if (fs.existsSync(rendererFile)) {
|
||||||
tagDef.renderer = rendererFile;
|
tagDef.renderer = rendererFile;
|
||||||
} else if (fs.existsSync(templateFile)) {
|
} else if (fs.existsSync(templateFile)) {
|
||||||
tagDef.template = templateFile;
|
tagDef.template = templateFile;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid tag. Neither a renderer or a template was found for tag.');
|
throw new Error('Invalid tag file: ' + tagFile + '. Neither a renderer or a template was found for tag.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user