diff options
Diffstat (limited to 'lib/cli/index.js')
-rw-r--r-- | lib/cli/index.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/cli/index.js b/lib/cli/index.js index 4bb926b..c9a2e8f 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -1,4 +1,5 @@ -var Output = require('../output/base'); +var path = require('path'); + var PluginsManager = require('../plugins'); var helper = require('./helper'); @@ -39,6 +40,26 @@ module.exports = { var plugins = new PluginsManager(book); return plugins.install(); }) + }, + + { + name: 'build [book] [output]', + description: 'build a book', + options: [ + helper.options.log, + helper.options.format + ], + exec: helper.outputCmd(function(output, args, kwargs) { + return output.book.parse() + .then(function() { + // Set output folder + if (args[0]) { + output.book.config.set('output', path.resolve(process.cwd(), args[0])); + } + + return output.generate(); + }); + }) } |