summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;