summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Graf <davidagraf@gmail.com>2014-05-15 08:07:24 +0200
committerDavid Graf <davidagraf@gmail.com>2014-05-15 08:07:24 +0200
commit0b0ac46e342d92959099e78c5cf1a8b26d309dbd (patch)
tree792a0bd158d61d404488811606c0e3a42f0f6c3d
parent622bbcb8ea24238cbb34bed2cbd7105f6d4d7351 (diff)
downloadgitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.zip
gitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.tar.gz
gitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.tar.bz2
Introducing option to disable cache manifest generation
-rwxr-xr-xbin/gitbook.js1
-rw-r--r--lib/generate/site/index.js10
2 files changed, 8 insertions, 3 deletions
diff --git a/bin/gitbook.js b/bin/gitbook.js
index 88083b9..1fd8797 100755
--- a/bin/gitbook.js
+++ b/bin/gitbook.js
@@ -26,6 +26,7 @@ build.command(prog.command('serve [source_dir]'))
.description('Build then serve a gitbook from a directory')
.option('-p, --port <port>', 'Port for server to listen on', 4000)
.option('--no-watch', 'Disable restart with file watching')
+.option('--no-cache', 'Disable cache manifest generation')
.action(function(dir, options) {
var server = new Server();
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index b63f703..6033fb4 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -237,9 +237,13 @@ Generator.prototype.writeCacheManifest = function() {
};
Generator.prototype.finish = function() {
- return this.copyAssets()
- .then(this.writeSearchIndex)
- .then(this.writeCacheManifest);
+ var deferred = this.copyAssets().then(this.writeSearchIndex);
+
+ if (this.options.cache) {
+ deferred = deferred.then(this.writeCacheManifest);
+ }
+
+ return deferred;
};
module.exports = Generator;