Skip to content

Commit caa7e31

Browse files
author
Ilya Radchenko
committed
ResolveTheme handles own default
1 parent 9fd2d62 commit caa7e31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/resolve_theme.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ var path = require('path'),
66
/**
77
* Given the name of a theme as a module, return the directory it
88
* resides in, or throw an error if it is not found
9-
* @param {string} theme the module name
9+
* @param {string} [theme='documentation-theme-default'] the module name
1010
* @throws {Error} if theme is not found
1111
* @returns {string} directory
1212
*/
1313
function resolveTheme(theme) {
14+
if (!theme) {
15+
return path.dirname(resolve.sync('documentation-theme-default', { basedir: __dirname }));
16+
}
17+
1418
try {
1519
return path.dirname(resolve.sync(theme, { basedir: process.cwd() }));
1620
} catch (e) {

0 commit comments

Comments
 (0)