summaryrefslogtreecommitdiffstats
path: root/bin/build.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-14 19:48:12 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-14 19:48:12 +0200
commit05f1eed9cee6ba0cbffb3285803fd6e9760291ef (patch)
treedbe1340b916dddeb817dabef6a9a6f9832853dd2 /bin/build.js
parentc0ca055bf4c5cbc776b2822afaa3a1efb1b97c19 (diff)
downloadgitbook-05f1eed9cee6ba0cbffb3285803fd6e9760291ef.zip
gitbook-05f1eed9cee6ba0cbffb3285803fd6e9760291ef.tar.gz
gitbook-05f1eed9cee6ba0cbffb3285803fd6e9760291ef.tar.bz2
Fix #91: Extract defaults title and description from README.md
Diffstat (limited to 'bin/build.js')
-rw-r--r--bin/build.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/bin/build.js b/bin/build.js
index 4133d50..3059dde 100644
--- a/bin/build.js
+++ b/bin/build.js
@@ -24,27 +24,13 @@ var makeBuildFunc = function(converter) {
return null;
})
.then(function(repoID) {
- var title = options.title;
- var githubID = options.github || repoID;
-
- if (!title && !githubID) {
- throw new Error('Needs either a title or a githubID (username/repo).\n'+
- ' If using github, either set repo origin to a github repo or use the -g flag.\n'+
- ' For title, use the -t flag.');
- } else if (!title) {
- var parts = githubID.split('/', 2);
- var user = parts[0], repo = parts[1];
-
- title = utils.titleCase(repo);
- }
-
return converter(
_.extend(options || {}, {
input: dir,
output: outputDir,
- title: title,
+ title: options.title,
description: options.intro,
- github: githubID,
+ github: options.github || repoID,
githubHost: options.githubHost,
generator: options.format,
theme: options.theme