diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-28 14:47:34 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-28 14:47:34 +0100 |
commit | 4aa66338fce505566a2fe6ba6aee79ddf3f656a2 (patch) | |
tree | ffce4b558735f6a41228542f8c36e3a6ba1e562d /lib/cli | |
parent | 8cda844ef12cf87525024348c104413def02ed7f (diff) | |
download | gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.zip gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.tar.gz gitbook-4aa66338fce505566a2fe6ba6aee79ddf3f656a2.tar.bz2 |
Add init command
Diffstat (limited to 'lib/cli')
-rw-r--r-- | lib/cli/index.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/cli/index.js b/lib/cli/index.js index 4d3d364..f1aca5e 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -7,6 +7,7 @@ var tinylr = require('tiny-lr'); var Promise = require('../utils/promise'); var PluginsManager = require('../plugins'); var Book = require('../book'); +var initBook = require('../init'); var helper = require('./helper'); var Server = require('./server'); @@ -14,6 +15,17 @@ var watch = require('./watch'); module.exports = { commands: [ + { + name: 'init [book]', + description: 'setup and create files for chapters', + options: [ + helper.options.log + ], + exec: function(args) { + var input = path.resolve(args[0] || process.cwd()); + return Book.init(helper.nodeFS, input); + } + }, { name: 'parse [book]', |