diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-17 13:12:34 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-17 13:12:34 +0100 |
commit | b6104c64fecb72c9f40554600d456c27dbd18be8 (patch) | |
tree | 0c48caf160f8b8a2c54f4cfa76c0f586364dbc8b /lib/cli/index.js | |
parent | e95678cf3a3cfbcbfa8b64ca16c4030417187e88 (diff) | |
download | gitbook-b6104c64fecb72c9f40554600d456c27dbd18be8.zip gitbook-b6104c64fecb72c9f40554600d456c27dbd18be8.tar.gz gitbook-b6104c64fecb72c9f40554600d456c27dbd18be8.tar.bz2 |
Use same json for page context and json builds
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(); + }); + }) } |