summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
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 /lib/generate/site/index.js
parent622bbcb8ea24238cbb34bed2cbd7105f6d4d7351 (diff)
downloadgitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.zip
gitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.tar.gz
gitbook-0b0ac46e342d92959099e78c5cf1a8b26d309dbd.tar.bz2
Introducing option to disable cache manifest generation
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js10
1 files changed, 7 insertions, 3 deletions
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;