1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-05 01:56:21 +00:00

Support explicit -o output parameter.

Allow output files to be explicitly specified via -o, for ex:

fluentcmd resume.json -o out/resume.html -o out/resume.pdf
This commit is contained in:
devlinjd 2015-10-10 21:39:32 -04:00
parent cf15738f58
commit 2e5a68d942

View File

@ -13,8 +13,9 @@ try {
console.log( '*** FluentCMD v' + PKG.version + ' ***' );
if( process.argv.length <= 2 ) { throw { fluenterror: 3 }; }
var args = ARGS( process.argv.slice(2) );
var src = args._.filter( function( a ) { return a.match(/\.json$/); });
var dst = args._.filter( function( a ) { return !a.match(/\.json$/); });
var src = args._ || [];
var dst = (args.o && ((typeof args.o === 'string' && [ args.o ]) || args.o)) || [];
dst = (dst === true) ? [] : dst; // handle -o with missing output file
FCMD.generate( src, dst, args.t || 'modern' );
process.platform !== 'win32' && console.log('\n');
}
@ -22,7 +23,7 @@ catch( ex ) {
var msg = '';
if( ex.fluenterror ){
switch( ex.fluenterror ) {
switch( ex.fluenterror ) { // TODO: Remove magic numbers
case 1: msg = "The specified theme couldn't be found: " + ex.data; break;
case 2: msg = "Couldn't copy CSS file to destination folder"; break;
case 3: msg = "Please specify a valid JSON resume file."; break;