mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 08:20:11 +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:
parent
cf15738f58
commit
2e5a68d942
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user