summaryrefslogtreecommitdiffstats
path: root/lib/cli/index.js
diff options
context:
space:
mode:
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);
+ });
});
})