1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00
This commit is contained in:
hacksalot
2016-01-21 23:40:15 -05:00
parent a935fe7dc2
commit 01c053702d
7 changed files with 48 additions and 9 deletions

View File

@ -15,7 +15,9 @@ Definition of the FRESHTheme class.
, parsePath = require('parse-filepath')
, pathExists = require('path-exists').sync
, EXTEND = require('extend')
, HMSTATUS = require('./status-codes')
, moment = require('moment')
, loadSafeJson = require('../utils/safe-json-loader')
, READFILES = require('recursive-readdir-sync');
@ -46,11 +48,17 @@ Definition of the FRESHTheme class.
// Load the theme
var themeFile = PATH.join( themeFolder, 'theme.json' );
var themeInfo = JSON.parse( FS.readFileSync( themeFile, 'utf8' ) );
var themeInfo = loadSafeJson( themeFile );
if( themeInfo.ex ) throw {
fluenterror: themeInfo.ex.operation === 'parse' ?
HMSTATUS.parseError : HMSTATUS.readError,
inner: themeInfo.ex.inner
};
var that = this;
// Move properties from the theme JSON file to the theme object
EXTEND( true, this, themeInfo );
EXTEND( true, this, themeInfo.json );
// Check for an "inherits" entry in the theme JSON.
if( this.inherits ) {

View File

@ -28,7 +28,8 @@ Status codes for HackMyResume.
invalidHelperUse: 18,
mixedMerge: 19,
invokeTemplate: 20,
compileTemplate: 21
compileTemplate: 21,
themeLoad: 22
};
}());