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.js41
1 files changed, 21 insertions, 20 deletions
diff --git a/lib/cli/index.js b/lib/cli/index.js
index f1aca5e..cf0f73f 100644
--- a/lib/cli/index.js
+++ b/lib/cli/index.js
@@ -131,26 +131,27 @@ module.exports = {
// Generate the book
.then(function() {
- return Book.setup(helper.nodeFS, input, {
- 'logLevel': kwargs.log
- })
- .then(function(book) {
- return book.parse()
- .then(function() {
- // Add livereload plugin
- book.config.set('plugins',
- book.config.get('plugins')
- .concat([
- { name: 'livereload' }
- ])
- );
-
- var Out = helper.FORMATS[kwargs.format];
- var output = new Out(book);
-
- return output.generate()
- .thenResolve(output);
- });
+ var book = new Book({
+ fs: helper.nodeFS,
+ root: input,
+ logLevel: kwargs.log
+ });
+
+ return book.parse()
+ .then(function() {
+ // Add livereload plugin
+ book.config.set('plugins',
+ book.config.get('plugins')
+ .concat([
+ { name: 'livereload' }
+ ])
+ );
+
+ var Out = helper.FORMATS[kwargs.format];
+ var output = new Out(book);
+
+ return output.generate()
+ .thenResolve(output);
});
})