From e0a3f0cea550d05dc0e4d2ce689fe58315f043ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 4 Sep 2015 18:58:16 +0200 Subject: [PATCH] Add warning for too strict gitbook version --- lib/configuration.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/configuration.js b/lib/configuration.js index f51091811..b7dccfe2d 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -121,8 +121,8 @@ Configuration.prototype.load = function() { if (!semver.satisfies(pkg.version, that.options.gitbook)) { throw "GitBook version doesn't satisfy version required by the book: "+that.options.gitbook; } - 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")); + if (that.options.gitbook != '*' && !semver.satisfies(that.options.gitbook, semver.inc(pkg.version, 'patch'))) { + 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 || path.join(that.book.root, "_book")); diff --git a/package.json b/package.json index 91e48e7ff..f187fcf3e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "nunjucks-autoescape": "1.0.0", "nunjucks-filter": "1.0.0", "i18n": "0.5.0", - "semver": "2.2.1", + "semver": "5.0.1", "npmi": "0.1.1", "cheerio": "0.19.0", "gitbook-plugin-livereload": "0.0.1",