From bf5c040971382b253a5d5ae04f3e68b04781c1d4 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Tue, 29 Dec 2015 03:10:26 -0500 Subject: [PATCH] Copy JRS theme assets to target. --- package.json | 1 + src/verbs/generate.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index aa96010..36504f8 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "homepage": "https://github.com/hacksalot/HackMyResume", "dependencies": { "colors": "^1.1.2", + "copy": "^0.1.3", "fluent-themes": "~0.7.1-beta", "fresca": "~0.2.2", "fs-extra": "^0.24.0", diff --git a/src/verbs/generate.js b/src/verbs/generate.js index 0061ab2..5c07ee9 100644 --- a/src/verbs/generate.js +++ b/src/verbs/generate.js @@ -57,7 +57,8 @@ // Load input resumes... if( !src || !src.length ) { throw { fluenterror: 3 }; } - var sheets = ResumeFactory.load( src, _log, null, theTheme.render ? 'JRS' : 'FRESH' ); + var sheets = ResumeFactory.load( src, _log, null, + theTheme.render ? 'JRS' : 'FRESH' ); // Merge input resumes... var msg = ''; @@ -128,9 +129,21 @@ theFormat = _fmts.filter( function(fmt) { return fmt.name === targInfo.fmt.outFormat; })[0]; - MKDIRP.sync( PATH.dirname( f ) ); // Ensure dest folder exists; + var outFolder = PATH.dirname( f ); + MKDIRP.sync( outFolder ); // Ensure dest folder exists; + + // TODO: refactor if( theme.render ) { + var COPY = require('copy'); + var globs = [ /*'**',*/ '*.css', '*.js', '*.png', '*.jpg', '*.gif', '*.bmp' ]; + COPY.sync( globs , outFolder, { + cwd: theme.folder, nodir: true, + ignore: ['node_modules/','node_modules/**'] + // rewrite: function(p1, p2) { + // return PATH.join(p2, p1); + // } + }); var rezHtml = theme.render( rez ); FS.writeFileSync( f, rezHtml ); }