diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/build.js | 18 | ||||
-rwxr-xr-x | bin/gitbook.js | 4 |
2 files changed, 4 insertions, 18 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 diff --git a/bin/gitbook.js b/bin/gitbook.js index e3d8a36..773e566 100755 --- a/bin/gitbook.js +++ b/bin/gitbook.js @@ -21,8 +21,8 @@ var buildCommand = function(command) { return command .option('-o, --output <directory>', 'Path to output directory, defaults to ./_book') .option('-f, --format <name>', 'Change generation format, defaults to site, availables are: '+_.keys(generators).join(", ")) - .option('-t, --title <name>', 'Name of the book to generate, defaults to repo name') - .option('-i, --intro <intro>', 'Description of the book to generate') + .option('-t, --title <name>', 'Name of the book to generate, default is extracted from readme') + .option('-i, --intro <intro>', 'Description of the book to generate, default is extracted from readme') .option('-g, --github <repo_path>', 'ID of github repo like : username/repo') .option('--githubHost <url>', 'The url of the github host (defaults to https://github.com/') .option('--theme <path>', 'Path to theme directory'); |