diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-21 09:41:29 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-09-21 09:41:29 +0200 |
commit | 9435dae6cdb14d30200925f30946672265807a84 (patch) | |
tree | 10c45b5550fe71a9ba0bf77331db4a7806bce008 /lib/configuration.js | |
parent | 813210bf470308367bc15b569749a1458711bc26 (diff) | |
download | gitbook-9435dae6cdb14d30200925f30946672265807a84.zip gitbook-9435dae6cdb14d30200925f30946672265807a84.tar.gz gitbook-9435dae6cdb14d30200925f30946672265807a84.tar.bz2 |
Fix #939: don't check gitbook version for sub-books (checked for parent)
Diffstat (limited to 'lib/configuration.js')
-rw-r--r-- | lib/configuration.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/configuration.js b/lib/configuration.js index e176f80..2412ff3 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -114,11 +114,13 @@ Configuration.prototype.load = function() { } }) .then(function() { - if (!semver.satisfies(pkg.version, that.options.gitbook)) { - throw new Error("GitBook version doesn't satisfy version required by the book: "+that.options.gitbook); - } - if (that.options.gitbook != "*" && !semver.satisfies(semver.inc(pkg.version, "patch"), that.options.gitbook)) { - that.book.log.warn.ln("gitbook version specified in your book.json might be too strict for future patches, \""+(_.first(pkg.version.split("."))+".x.x")+"\" is more adequate"); + if (!that.book.isSubBook()) { + if (!semver.satisfies(pkg.version, that.options.gitbook)) { + throw new Error("GitBook version doesn't satisfy version required by the book: "+that.options.gitbook); + } + if (that.options.gitbook != "*" && !semver.satisfies(semver.inc(pkg.version, "patch"), that.options.gitbook)) { + that.book.log.warn.ln("gitbook version specified in your book.json might be too strict for future patches, \""+(_.first(pkg.version.split("."))+".x.x")+"\" is more adequate"); + } } that.options.output = path.resolve(that.options.output || that.book.resolve("_book")); |