1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-24 17:30:10 +00:00

Return processed resume data.

Return the array of processed resume (string/text) data in addition to
the rendered output files.
This commit is contained in:
James Devlin 2015-09-04 23:46:53 -04:00
parent cc0c7512d8
commit a90139dd6f

View File

@ -58,7 +58,13 @@ module.exports = function () {
}); });
// Run the transformation! // Run the transformation!
targets.map( gen ); var finished = targets.map( gen );
return {
sheet: rez,
targets: targets,
processed: finished
};
} }
/** /**
@ -74,7 +80,7 @@ module.exports = function () {
console.log( 'Generating ' + fName.toUpperCase() + ' resume: ' + fOut ); console.log( 'Generating ' + fName.toUpperCase() + ' resume: ' + fOut );
var themeFile = path.join( __dirname, '../../blueprint/', _opts.theme, var themeFile = path.join( __dirname, '../../blueprint/', _opts.theme,
fName + '.' + (fObj.fmt || fObj.ext)); fName + '.' + (fObj.fmt || fObj.ext));
var cssData = (fName != 'html' && fName != 'pdf') ? null : var cssData = (fName !== 'html' && fName !== 'pdf') ? null :
FS.readFileSync( path.join( __dirname, '../../blueprint/', _opts.theme, 'html.css' ), 'utf8' ); FS.readFileSync( path.join( __dirname, '../../blueprint/', _opts.theme, 'html.css' ), 'utf8' );
var mk = FS.readFileSync( themeFile, 'utf8' ); var mk = FS.readFileSync( themeFile, 'utf8' );
@ -85,6 +91,8 @@ module.exports = function () {
fName === 'html' && (mk = html( mk, themeFile, fOut )); fName === 'html' && (mk = html( mk, themeFile, fOut ));
fName === 'pdf' && pdf( mk, fOut ); fName === 'pdf' && pdf( mk, fOut );
fName !== 'pdf' && FS.writeFileSync( fOut, mk, 'utf8' ); fName !== 'pdf' && FS.writeFileSync( fOut, mk, 'utf8' );
return mk;
} }
catch( ex ) { catch( ex ) {
err( ex ); err( ex );