Compare commits

...

5 Commits

Author SHA1 Message Date
Samy Pessé 532e8b0388 Bump version to 2.0.0-alpha.5 2015-02-05 13:56:52 +01:00
Samy Pessé 35b3d50012 Add "finish:before" to the list of valid hooks 2015-02-05 13:56:43 +01:00
Samy Pessé 72ff9996ce Update fs-extra to fix fs.copy issue 2015-02-05 13:51:53 +01:00
Samy Pessé 0759c4dd78 Bump version to 2.0.0-alpha.4 2015-02-04 20:49:09 +01:00
Samy Pessé 82a1a151e4 Correctly copy cover for sub books 2015-02-04 20:29:49 +01:00
5 changed files with 11 additions and 4 deletions
+5
View File
@@ -646,6 +646,11 @@ Book.prototype.parentRoot = function() {
return this.root;
};
// Return true if it's a sub-book
Book.prototype.isSubBook = function() {
return !!this.parent;
};
// Resolve a path in book
Book.prototype.resolve = function(p) {
return path.resolve(this.root, p);
+2
View File
@@ -107,6 +107,8 @@ Configuration.prototype.load = function() {
if (that.options.gitbook == "*") {
that.book.log.warn.ln("you should specify a gitbook version to use in your book.json, for example: "+(_.first(pkg.version.split("."))+".x.x"));
}
that.options.gitbook = pkg.version;
});
};
+1 -1
View File
@@ -58,7 +58,7 @@ BaseGenerator.prototype.copyCover = function() {
])
.fail(function() {
// If orignaly from multi-lang, try copy from parent
if (!that.isMultilingual()) return;
if (!that.book.isSubBook()) return;
return Q.all([
fs.copy(path.join(that.book.parentRoot(), "cover.jpg"), path.join(that.options.output, "cover.jpg")),
+1 -1
View File
@@ -33,7 +33,7 @@ var Plugin = function(book, name) {
// Type of plugins resources
Plugin.RESOURCES = ["js", "css"];
Plugin.HOOKS = [
"init", "finish"
"init", "finish", "finish:before"
]
// Load from a name
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.5",
"homepage": "https://www.gitbook.com",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",
@@ -10,7 +10,7 @@
"lodash": "2.4.1",
"graceful-fs": "3.0.5",
"resolve": "0.6.3",
"fs-extra": "0.14.0",
"fs-extra": "0.16.3",
"fstream-ignore": "1.0.2",
"gitbook-parsers": "0.3.1",
"nunjucks": "git+https://github.com/SamyPesse/nunjucks.git#4019d1b7379372336b86ce1b0bf84352a2029747",