summaryrefslogtreecommitdiffstats
path: root/lib/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 16:30:52 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 16:30:52 +0100
commit41c3db4c049c98f1a6fc5af9068757306ef26214 (patch)
tree63d9629d0e999a08e0d3a42458a108c11e3e0c79 /lib/index.js
parent7f01f4b048faf5ce5e1815c3676916ac7859279f (diff)
downloadgitbook-41c3db4c049c98f1a6fc5af9068757306ef26214.zip
gitbook-41c3db4c049c98f1a6fc5af9068757306ef26214.tar.gz
gitbook-41c3db4c049c98f1a6fc5af9068757306ef26214.tar.bz2
Add command to install plugins
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/index.js b/lib/index.js
index 8b7a390..a71d325 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -3,6 +3,7 @@ var _ = require("lodash");
var path = require("path");
var Book = require("./book");
+var Plugin = require("./plugin");
module.exports = {
Book: Book,
@@ -10,7 +11,7 @@ module.exports = {
commands: [
{
name: "build",
- description: "Build a book",
+ description: "build a book",
exec: function(args, kwargs) {
var input = args[0] || process.cwd();
var output = args[1] || path.join(input, "_book");
@@ -24,6 +25,20 @@ module.exports = {
return book.generate();
});
}
+ },
+ {
+ name: "install",
+ description: "install plugins dependencies",
+ exec: function(args, kwargs) {
+ var input = args[0] || process.cwd();
+
+ var book = new Book(input);
+
+ return book.config.load()
+ .then(function() {
+ return Plugin.install(input, book.options.plugins);
+ });
+ }
}
]
};