diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-28 20:29:36 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-28 20:29:36 +0200 |
commit | 23056fc85da957d6f63808e59e13d8bd646a215d (patch) | |
tree | 022bdc72e87ef34677951b6743df291522661899 /bin/build.js | |
parent | 5f1bfc02805e074ab47bc8966410cf8042363c48 (diff) | |
download | gitbook-23056fc85da957d6f63808e59e13d8bd646a215d.zip gitbook-23056fc85da957d6f63808e59e13d8bd646a215d.tar.gz gitbook-23056fc85da957d6f63808e59e13d8bd646a215d.tar.bz2 |
Use a global configuration file for a book (default to book.json)
Diffstat (limited to 'bin/build.js')
-rw-r--r-- | bin/build.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/bin/build.js b/bin/build.js index 597b0de..36ffcbe 100644 --- a/bin/build.js +++ b/bin/build.js @@ -15,7 +15,7 @@ var buildCommand = function(command) { .option('-t, --title <name>', 'Name of the book to generate, default is extracted from readme') .option('-i, --intro <intro>', 'Description of the book to generate, default is extracted from readme') .option('--plugins <plugins>', 'List of plugins to use separated by ","') - .option('--pluginsConfig <json file>', 'JSON File containing plugins configuration') + .option('--config <config file>', 'Configuration file to use, defualt to book.json') .option('-g, --github <repo_path>', 'ID of github repo like : username/repo') .option('--githubHost <url>', 'The url of the github host (defaults to https://github.com/'); }; @@ -26,13 +26,6 @@ var makeBuildFunc = function(converter) { dir = dir || process.cwd(); outputDir = options.output; - // Read plugins config - var pluginsConfig = {}; - if (options.pluginsConfig) { - pluginsConfig = JSON.parse(fs.readFileSync(options.pluginsConfig)) - } - - console.log('Starting build ...'); return converter( _.extend({}, options || {}, { @@ -44,7 +37,7 @@ var makeBuildFunc = function(converter) { githubHost: options.githubHost, generator: options.format, plugins: options.plugins, - pluginsConfig: pluginsConfig + configFile: options.config }) ) .then(function(output) { |