diff options
author | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:38:06 +0100 |
---|---|---|
committer | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:38:06 +0100 |
commit | 80794997a4ebfc5bf397132ff89ee8c76e99efbe (patch) | |
tree | 7b1f922ecb1551c0f8c55ef875a5db9aa90ea2d6 /bin/build.js | |
parent | ec719891a1d652873cb6668d94a141b77adea3df (diff) | |
download | gitbook-80794997a4ebfc5bf397132ff89ee8c76e99efbe.zip gitbook-80794997a4ebfc5bf397132ff89ee8c76e99efbe.tar.gz gitbook-80794997a4ebfc5bf397132ff89ee8c76e99efbe.tar.bz2 |
Make use of github optional
Diffstat (limited to 'bin/build.js')
-rw-r--r-- | bin/build.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/build.js b/bin/build.js index 6050b88..9f3ad1d 100644 --- a/bin/build.js +++ b/bin/build.js @@ -24,16 +24,20 @@ var buildFunc = function(dir, options) { return null; }) .then(function(repoID) { - var githubID = options.github || repoID; + var title = options.title; - if(!githubID) { - throw new Error('Needs a githubID (username/repo). Either set repo origin to a github repo or use the -g flag'); - } + if (!title) { + var githubID = options.github || repoID; + + if(!githubID) { + throw new Error('Needs a githubID (username/repo). Either set repo origin to a github repo or use the -g flag'); + } - var parts = githubID.split('/', 2); - var user = parts[0], repo = parts[1]; + var parts = githubID.split('/', 2); + var user = parts[0], repo = parts[1]; - var title = options.title || utils.titleCase(repo); + title = options.title || utils.titleCase(repo); + } return generate.folder( _.extend(options.options || {}, { @@ -110,4 +114,4 @@ var buildFiles = function(dir, outputFile, options, masterOptions) { module.exports = { folder: buildFunc, files: buildFiles -};
\ No newline at end of file +}; |