From f65cf8880e6885d18e4854905fe04c11cdc4faf2 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Mon, 4 Jan 2016 02:50:00 -0500 Subject: [PATCH] Add support for external options file. --- src/index.js | 45 ++++++++++++++++++++++++++++------- src/utils/safe-json-loader.js | 24 +++++++++++++++++++ src/utils/syntax-error-ex.js | 3 ++- 3 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 src/utils/safe-json-loader.js diff --git a/src/index.js b/src/index.js index f3d3ccf..d5c9ca2 100644 --- a/src/index.js +++ b/src/index.js @@ -14,9 +14,11 @@ var SPAWNW = require('./core/spawn-watch') , FCMD = require( './hackmycmd') , PKG = require('../package.json') , FS = require('fs') + , EXTEND = require('./utils/extend') , chalk = require('chalk') , PATH = require('path') , HACKMYSTATUS = require('./core/status-codes') + , safeLoadJSON = require('./utils/safe-json-loader') , _opts = { } , title = chalk.white.bold('\n*** HackMyResume v' + PKG.version + ' ***') , StringUtils = require('./utils/string.js') @@ -40,13 +42,6 @@ function main() { var args = initialize(); - function execVerb( src, dst, opts, log ) { - _opts = opts; - _opts.silent = this.parent.silent; - _opts.opts = this.parent.opts; - FCMD.verbs[ this.name() ].call( null, src, dst, opts, log ); - } - // Create the top-level (application) command... var program = new Command('hackmyresume') .version(PKG.version) @@ -100,7 +95,7 @@ function main() { .alias('generate') //.arguments(' TO [targets]') //.usage('...') - .option('-t --theme ', 'Theme name or path', 'modern') + .option('-t --theme ', 'Theme name or path') .option('-n --no-prettify', 'Disable HTML prettification', true) .option('-c --css