summaryrefslogtreecommitdiffstats
path: root/lib/cli/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-29 17:35:12 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-29 17:35:12 +0100
commitec353e179dedf1ebf1ab6e54f6217a88d087ea75 (patch)
tree4a6e90f89a56ea571c0a090e6a524f760da8aa3b /lib/cli/index.js
parent496f253e698f1224fa9f9cf88670648ff3930d7a (diff)
downloadgitbook-ec353e179dedf1ebf1ab6e54f6217a88d087ea75.zip
gitbook-ec353e179dedf1ebf1ab6e54f6217a88d087ea75.tar.gz
gitbook-ec353e179dedf1ebf1ab6e54f6217a88d087ea75.tar.bz2
Remove .gitbook and add "root" option
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);
});
})