Skip to content

Commit 66afb26

Browse files
author
Ilya Radchenko
committed
Make resolve a little cleaner, always throw error
1 parent caa7e31 commit 66afb26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/resolve_theme.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ var path = require('path'),
1111
* @returns {string} directory
1212
*/
1313
function resolveTheme(theme) {
14-
if (!theme) {
15-
return path.dirname(resolve.sync('documentation-theme-default', { basedir: __dirname }));
16-
}
14+
var basedir = theme ? process.cwd() : __dirname;
15+
16+
theme = theme || 'documentation-theme-default';
1717

1818
try {
19-
return path.dirname(resolve.sync(theme, { basedir: process.cwd() }));
19+
return path.dirname(resolve.sync(theme, { basedir: basedir }));
2020
} catch (e) {
2121
throw new Error('Theme ' + theme + ' not found');
2222
}

0 commit comments

Comments
 (0)