From 3805a36271058e7f11d1a42d4866ebdd7d46c39e Mon Sep 17 00:00:00 2001 From: devlinjd Date: Wed, 9 Dec 2015 23:30:53 -0500 Subject: [PATCH] Fix folder generation wrinkle. --- src/core/theme.js | 1 + src/gen/template-generator.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/theme.js b/src/core/theme.js index 9d43efd..3d971a0 100644 --- a/src/core/theme.js +++ b/src/core/theme.js @@ -44,6 +44,7 @@ Abstract theme representation. // then this theme declares its files explicitly. if( !!this.formats ) { formatsHash = loadExplicit.call( this ); + this.explicit = true; } else { formatsHash = loadImplicit.call( this ); diff --git a/src/gen/template-generator.js b/src/gen/template-generator.js index 5c68832..3788c8f 100644 --- a/src/gen/template-generator.js +++ b/src/gen/template-generator.js @@ -104,7 +104,7 @@ Template-based resume generator base for FluentCV. if( tplInfo.action === 'transform' ) { transform.call( that, rez, f, tplInfo, theme, outFolder ); } - else if( tplInfo.action === null ) { + else if( tplInfo.action === null && theme.explicit ) { var thisFilePath = PATH.join(outFolder, tplInfo.orgPath); try { MKDIRP.sync( PATH.dirname(thisFilePath) ); @@ -195,7 +195,7 @@ Template-based resume generator base for FluentCV. this.onBeforeSave && (mk = this.onBeforeSave( { mk: mk, theme: theme, outputFile: f } )); var thisFilePath = PATH.join( outFolder, tplInfo.orgPath ); try { - MKDIRP.sync( PATH.dirname(thisFilePath) ); + MKDIRP.sync( PATH.dirname( tplInfo.major ? f : thisFilePath) ); FS.writeFileSync( tplInfo.major ? f : thisFilePath, mk, { encoding: 'utf8', flags: 'w' } ); } catch(ex) {