summaryrefslogtreecommitdiffstats
path: root/lib/cli/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-23 15:05:32 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-23 15:05:32 +0100
commitf052aacee1140f211ebb9454157fa7a3604005cf (patch)
treef784d8b9fd70bd94b754e13d26e6f6dd548b9908 /lib/cli/index.js
parent13e2ff8035d9a93e4ee8eb79ec71ac92e6f2bf7e (diff)
downloadgitbook-f052aacee1140f211ebb9454157fa7a3604005cf.zip
gitbook-f052aacee1140f211ebb9454157fa7a3604005cf.tar.gz
gitbook-f052aacee1140f211ebb9454157fa7a3604005cf.tar.bz2
Add .gitbook to locate book inside repository
Diffstat (limited to 'lib/cli/index.js')
-rw-r--r--lib/cli/index.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/cli/index.js b/lib/cli/index.js
index 78c5286..0b2366a 100644
--- a/lib/cli/index.js
+++ b/lib/cli/index.js
@@ -114,22 +114,21 @@ module.exports = {
// Generate the book
.then(function() {
- var book = new Book({
- fs: new NodeFS(),
- root: input,
+ return Book.setup(helper.nodeFS, input, {
'config': {
'defaultsPlugins': ['livereload']
},
'logLevel': kwargs.log
- });
-
- return book.parse()
- .then(function() {
- var Out = helper.FORMATS[kwargs.format];
- var output = new Out(book);
-
- return output.generate()
- .thenResolve(output);
+ })
+ .then(function(book) {
+ return book.parse()
+ .then(function() {
+ var Out = helper.FORMATS[kwargs.format];
+ var output = new Out(book);
+
+ return output.generate()
+ .thenResolve(output);
+ });
});
})