Skip to content

Commit 6f8c91f

Browse files
committed
Merge pull request #8 from hollandmatt/master
Fallback to default theme filename if specified one doesn't exist (Fixes #2)
2 parents b44e7a9 + ef4f977 commit 6f8c91f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ module.exports = function (source) {
1010
var fromBuild = options.fromBuild || true;
1111
var themeName = options.theme || DEFAULT_NAME;
1212
var themePath = path.resolve(themeName);
13+
14+
var themeExists = fs.existsSync(themePath);
15+
if (!themeExists) {
16+
// if themePath is not readable, fall back to default theme name
17+
themePath = path.resolve(DEFAULT_NAME);
18+
}
19+
1320
var heading = HEADING;
1421

1522
if (!fromBuild) {

0 commit comments

Comments
 (0)