diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-28 21:25:58 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-28 21:25:58 +0200 |
commit | 826f90505c1a70ad2a8cf3715bac6d5efaeba22c (patch) | |
tree | a35600d555ff0268f6eb2fc1bd9c44c06438eb27 /lib/cli | |
parent | 7ae36f16c84238340dd6b39a75423f5e95f27bbc (diff) | |
download | gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.zip gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.tar.gz gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.tar.bz2 |
Add command "init"
Diffstat (limited to 'lib/cli')
-rw-r--r-- | lib/cli/index.js | 5 | ||||
-rw-r--r-- | lib/cli/init.js | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/lib/cli/index.js b/lib/cli/index.js index b93b7b1..4afb090 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -1,9 +1,10 @@ module.exports = { commands: [ - require('./parse'), require('./build'), require('./serve'), - require('./install') + require('./install'), + require('./parse'), + require('./init') ] }; diff --git a/lib/cli/init.js b/lib/cli/init.js new file mode 100644 index 0000000..9a1bff8 --- /dev/null +++ b/lib/cli/init.js @@ -0,0 +1,17 @@ +var path = require('path'); + +var options = require('./options'); +var initBook = require('../init'); + +module.exports = { + name: 'install [book]', + description: 'setup and create files for chapters', + options: [ + options.log + ], + exec: function(args, kwargs) { + var bookRoot = path.resolve(process.cwd(), args[0] || './'); + + return initBook(bookRoot); + } +}; |