Skip to content

Commit c316eeb

Browse files
committed
Added error for invalid layouts.
1 parent dd39752 commit c316eeb

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

bin/doxdox

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,19 @@ fs.exists(filename, function (exists) {
8282

8383
data = dox.parseComments(fs.readFileSync(filename, 'utf8'));
8484

85-
process.stdout.write(templates[layout]({
86-
title: title,
87-
description: description,
88-
methods: utils.parseData(data)
89-
}));
85+
if (templates[layout]) {
86+
87+
process.stdout.write(templates[layout]({
88+
title: title,
89+
description: description,
90+
methods: utils.parseData(data)
91+
}));
92+
93+
} else {
94+
95+
console.log('Invalid layout specified.');
96+
97+
}
9098

9199
} else {
92100

0 commit comments

Comments
 (0)