summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-05-15 21:24:28 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-05-15 21:24:28 -0700
commitdab46c779dd762c68ff8201890e9fbe5c34faf66 (patch)
treeedde09f295dc3c68d4d1e5e0652e577b1f5f8844
parent58a5245d21706378cab4d540099ec64464cee422 (diff)
downloadgitbook-dab46c779dd762c68ff8201890e9fbe5c34faf66.zip
gitbook-dab46c779dd762c68ff8201890e9fbe5c34faf66.tar.gz
gitbook-dab46c779dd762c68ff8201890e9fbe5c34faf66.tar.bz2
Allow github support to be disabled in book.json
Fixes #238
-rw-r--r--lib/generate/index.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/generate/index.js b/lib/generate/index.js
index 6a07a21..86cdf7c 100644
--- a/lib/generate/index.js
+++ b/lib/generate/index.js
@@ -170,6 +170,16 @@ var generateBook = function(options) {
// Get repo's URL
.then(function() {
+ // Git deactivated
+ if(options.github === false) {
+ options.github = null;
+ return null;
+ } else if(options.github) {
+ // Git already specified in options
+ return options.github;
+ }
+
+ // Try auto detecting
return parse.git.url(options.input)
.then(function(_url) {
// Get ID of repo
@@ -178,7 +188,7 @@ var generateBook = function(options) {
return null;
})
.then(function(repoId) {
- options.github = options.github || repoId;
+ options.github = repoId;
});
})