From a90139dd6f3ee6ab4f627ac7d2af0080ef7c1f5f Mon Sep 17 00:00:00 2001 From: James Devlin Date: Fri, 4 Sep 2015 23:46:53 -0400 Subject: [PATCH] Return processed resume data. Return the array of processed resume (string/text) data in addition to the rendered output files. --- src/scrappy.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/scrappy.js b/src/scrappy.js index c246d6f..336d977 100644 --- a/src/scrappy.js +++ b/src/scrappy.js @@ -58,7 +58,13 @@ module.exports = function () { }); // 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 ); var themeFile = path.join( __dirname, '../../blueprint/', _opts.theme, 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' ); var mk = FS.readFileSync( themeFile, 'utf8' ); @@ -85,6 +91,8 @@ module.exports = function () { fName === 'html' && (mk = html( mk, themeFile, fOut )); fName === 'pdf' && pdf( mk, fOut ); fName !== 'pdf' && FS.writeFileSync( fOut, mk, 'utf8' ); + + return mk; } catch( ex ) { err( ex );