Permalink
Browse files

Fixed issue where theme.json was not being parsed

  • Loading branch information...
1 parent 4e07687 commit 01e533b2e5b1d93b01fd936c1747713ceb35c8b2 @davglass committed May 11, 2012
Showing with 12 additions and 6 deletions.
  1. +12 −6 lib/builder.js
View
@@ -333,20 +333,26 @@ YUI.add('doc-builder', function(Y) {
};
if (!this._meta) {
try {
- var meta;
- if (fs.existsSync(path.join(themeDir, 'theme.json'))) {
- meta = Y.Files.getJSON(path.join(themeDir, 'theme.json'));
+ var meta,
+ theme = path.join(themeDir, 'theme.json');
+ if (path.existsSync(theme)) {
+ Y.log('Loading theme from ' + theme, 'info', 'builder');
+ meta = Y.Files.getJSON(theme);
} else if (DEFAULT_THEME !== themeDir) {
- if (fs.existsSync(path.join(DEFAULT_THEME))) {
- meta = Y.Files.getJSON(path.join(DEFAULT_THEME, 'theme.json'));
+ theme = path.join(DEFAULT_THEME, 'theme.json')
+ if (path.existsSync(theme)) {
+ Y.log('Loading theme from ' + theme, 'info', 'builder');
+ meta = Y.Files.getJSON(theme);
}
}
if (meta) {
obj.meta = meta;
this._meta = meta;
}
- } catch (e) {}
+ } catch (e) {
+ console.error('Error', e);
+ }
} else {
obj.meta = this._meta;
}

0 comments on commit 01e533b

Please sign in to comment.