Improve logs for plugins installation

This commit is contained in:
Samy Pessé
2015-01-26 11:57:28 +01:00
parent decd8dbdc5
commit f70c29fea5
2 changed files with 9 additions and 2 deletions
+4
View File
@@ -45,6 +45,10 @@ $ gitbook build ./repository ./outputFolder
* [Variables and Templating](#variables-and-templating)
* [Content References](#content-references)
* [Plugins](#plugins)
* Interractive reader website:
* Search
* Font Settings (Serif, Sans Serif)
* Themes: white, sepia, night
## Output Formats
+5 -2
View File
@@ -129,11 +129,11 @@ Configuration.prototype.installPlugins = function(options) {
});
// Install plugins one by one
if (options.log) console.log(plugins.length+" plugins to install");
if (options.log) that.book.log.info.ln(plugins.length+" plugins to install");
return _.reduce(plugins, function(prev, plugin) {
return prev.then(function() {
var fullname = "gitbook-plugin-"+plugin.name;
if (options.log) console.log("Install plugin", plugin.name, "from npm ("+fullname+") with version", (plugin.version || "*"));
if (options.log) that.book.log.info.ln("install plugin", plugin.name, "from npm ("+fullname+") with version", (plugin.version || "*"));
return Q.nfcall(npmi, {
'name': fullname,
'version': plugin.version,
@@ -143,6 +143,9 @@ Configuration.prototype.installPlugins = function(options) {
'loaded': false,
'prefix': that.book.root
}
})
.then(function() {
that.book.log.info.ok("plugin", plugin.name, "installed with success");
});
});
}, Q());