summaryrefslogtreecommitdiffstats
path: root/lib/plugins/loadForBook.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-06-08 15:02:34 +0200
committerSamy Pessé <samypesse@gmail.com>2016-06-08 15:02:34 +0200
commit004f91f02c7b98005f8f7cc032ad24d8800651da (patch)
treed175bb7e4e9b8e2004f0ddde5f8d1e22797c501a /lib/plugins/loadForBook.js
parente6c6ec4293fdf0bd225f1c6613ea484469fa98fd (diff)
downloadgitbook-004f91f02c7b98005f8f7cc032ad24d8800651da.zip
gitbook-004f91f02c7b98005f8f7cc032ad24d8800651da.tar.gz
gitbook-004f91f02c7b98005f8f7cc032ad24d8800651da.tar.bz2
sortPlugins should not be async
Diffstat (limited to 'lib/plugins/loadForBook.js')
-rw-r--r--lib/plugins/loadForBook.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/plugins/loadForBook.js b/lib/plugins/loadForBook.js
index fd45a77..296cb01 100644
--- a/lib/plugins/loadForBook.js
+++ b/lib/plugins/loadForBook.js
@@ -7,11 +7,10 @@ var sortPlugins = require('./sortPlugins');
/**
- Load a list of plugins in a book
-
- @param {Book}
- @return {Promise<Map<String:Plugin>}
-*/
+ * Load a list of plugins in a book
+ * @param {Book}
+ * @return {Promise<Map<String:Plugin>}
+ */
function loadForBook(book) {
var logger = book.getLogger();
var requirements = listForBook(book);
@@ -28,9 +27,9 @@ function loadForBook(book) {
);
});
- return sortPlugins(installed, requirementsKeys);
- })
- .then(function(installed) {
+ // Sort plugins
+ installed = sortPlugins(installed, requirementsKeys);
+
// Log state
logger.info.ln(installed.size + ' plugins are installed');
if (requirements.size != installed.size) {