diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-17 10:11:33 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-17 10:11:33 +0100 |
commit | 8141bcb3b63f16c27f8cd6c5e19aed4b5ef6d019 (patch) | |
tree | 8714e7b6155f606260837ae62e45d262c12015a7 /lib/index.js | |
parent | db3d21db49a7260df03ae987b58c495178193dde (diff) | |
download | gitbook-8141bcb3b63f16c27f8cd6c5e19aed4b5ef6d019.zip gitbook-8141bcb3b63f16c27f8cd6c5e19aed4b5ef6d019.tar.gz gitbook-8141bcb3b63f16c27f8cd6c5e19aed4b5ef6d019.tar.bz2 |
Add command 'parse' for gitbook-cli
Diffstat (limited to 'lib/index.js')
-rw-r--r-- | lib/index.js | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/lib/index.js b/lib/index.js index e0d43eb..fdad6ee 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,40 +1,7 @@ var Book = require('./book'); -var Output = require('./output'); -var NodeFS = require('./fs/node'); - -// Setup a Book for the arguments -function setupBook(args) { - var input = args[0] || process.cwd(); - return new Book({ - fs: new NodeFS(), - root: input - }); -} - -// Setup an Output for the arguments -function setupOutput(Out, args) { - return new Out(setupBook(args)); -} +var cli = require('./cli'); module.exports = { Book: Book, - commands: [ - { - name: 'install [book]', - description: 'install all plugins dependencies', - exec: function(args) { - var book = setupBook(args); - - return book.config.load() - .then(function() { - return book.plugins.install(); - }) - .then(function(){ - console.log(''); - console.log(color.green('Done, without error')); - }); - } - }, - - ] + commands: cli.commands }; |