mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 08:20:11 +00:00
Restore canonical output filename.
This commit is contained in:
parent
2abfe4426c
commit
0395792359
@ -81,6 +81,7 @@ Abstract theme representation.
|
||||
// Set up a hash of formats supported by this theme.
|
||||
var formatsHash = { };
|
||||
var that = this;
|
||||
var major = false;
|
||||
|
||||
// Establish the base theme folder
|
||||
var tplFolder = PATH.join( this.folder, 'src' );
|
||||
@ -94,7 +95,7 @@ Abstract theme representation.
|
||||
// such as "/latex" or "/html", then that format is the output format
|
||||
// for all files within the folder.
|
||||
var pathInfo = PATH.parse(absPath);
|
||||
var outFmt = '';
|
||||
var outFmt = '', isMajor = false;
|
||||
var portion = pathInfo.dir.replace(tplFolder,'');
|
||||
if( portion && portion.trim() ) {
|
||||
var reg = /^(?:\/|\\)(html|latex|doc|pdf)(?:\/|\\)?/ig;
|
||||
@ -106,7 +107,8 @@ Abstract theme representation.
|
||||
// compact-[outputformat].[extension], for ex, compact-pdf.html.
|
||||
if( !outFmt ) {
|
||||
var idx = pathInfo.name.lastIndexOf('-');
|
||||
outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 )
|
||||
outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 );
|
||||
isMajor = true;
|
||||
}
|
||||
|
||||
// We should have a valid output format now.
|
||||
@ -119,6 +121,7 @@ Abstract theme representation.
|
||||
var obj = {
|
||||
action: 'transform',
|
||||
path: absPath,
|
||||
major: isMajor,
|
||||
orgPath: PATH.relative(that.folder, absPath),
|
||||
ext: pathInfo.ext.slice(1),
|
||||
title: friendlyName( outFmt ),
|
||||
|
@ -196,7 +196,7 @@ Template-based resume generator base for FluentCV.
|
||||
var thisFilePath = PATH.join( outFolder, tplInfo.orgPath );
|
||||
try {
|
||||
MKDIRP.sync( PATH.dirname(thisFilePath) );
|
||||
FS.writeFileSync( thisFilePath, mk, { encoding: 'utf8', flags: 'w' } );
|
||||
FS.writeFileSync( tplInfo.major ? f : thisFilePath, mk, { encoding: 'utf8', flags: 'w' } );
|
||||
}
|
||||
catch(ex) {
|
||||
console.log(ex);
|
||||
|
Loading…
Reference in New Issue
Block a user