mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-07-13 21:51:13 +01:00
Introduce scrappy sources from main dev tree.
Add existing "HackMyResume" command-line sources from commit 59 on the original dev tree, without modification except for a partial rename of "HackMyResume" to "scrappy". See: https://github.com/gruebait/HackMyResume/tree/master/HMR.Console
This commit is contained in:
29
src/index.js
Normal file
29
src/index.js
Normal file
@ -0,0 +1,29 @@
|
||||
#! /usr/bin/env node
|
||||
|
||||
/**
|
||||
Command-line resume generation logic for Scrappy.
|
||||
@license Copyright (c) 2015 by James M. Devlin. All rights reserved.
|
||||
*/
|
||||
|
||||
var ARGS = require( 'minimist' )
|
||||
, HMR = require( './hmr');
|
||||
|
||||
try {
|
||||
|
||||
console.log( '*** Scrappy v0.1.0 ***' );
|
||||
if( process.argv.length <= 2 ) { throw 'Please specify a JSON resume file.'; }
|
||||
|
||||
var args = ARGS( process.argv.slice(2) );
|
||||
var src = args._.filter( function( a ) { return a.endsWith('.json'); });
|
||||
var dst = args._.filter( function( a ) { return !a.endsWith('.json'); });
|
||||
HMR.generate( src, dst, args.t || 'default' );
|
||||
|
||||
}
|
||||
catch( ex ) {
|
||||
|
||||
var msg = ex.toString();
|
||||
var idx = msg.indexOf('Error: ');
|
||||
var trimmed = idx === -1 ? msg : msg.substring( idx + 7 );
|
||||
console.log( 'ERROR: ' + trimmed.toString() );
|
||||
|
||||
}
|
Reference in New Issue
Block a user