diff options
author | Shaform <shaform@gmail.com> | 2014-06-17 22:08:46 +0800 |
---|---|---|
committer | Shaform <shaform@gmail.com> | 2014-06-17 22:08:46 +0800 |
commit | 6bbefad24e6aa4a5b51b4b21bdf30b73f8cb4d41 (patch) | |
tree | d2efbbb62f9746b19b683c11a302c9afe385a2be /bin/build.js | |
parent | 1f4cf33dd08b439cadb5c649654ecd6d3f4b399d (diff) | |
parent | d6eb8e4c6042262408c3c0b8d67bccecfa4bf882 (diff) | |
download | gitbook-6bbefad24e6aa4a5b51b4b21bdf30b73f8cb4d41.zip gitbook-6bbefad24e6aa4a5b51b4b21bdf30b73f8cb4d41.tar.gz gitbook-6bbefad24e6aa4a5b51b4b21bdf30b73f8cb4d41.tar.bz2 |
Merge remote-tracking branch 'upstream/master' into ref_links
Diffstat (limited to 'bin/build.js')
-rw-r--r-- | bin/build.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/build.js b/bin/build.js index 5894d00..4bb6bb4 100644 --- a/bin/build.js +++ b/bin/build.js @@ -12,10 +12,15 @@ 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('--config <config file>', 'Configuration file to use, defualt to book.json') + .option('--config <config file>', 'Configuration file to use, defaults to book.js or book.json') }; +var buildEbookCommand = function(command) { + return buildCommand(command) + .option('-c, --cover <path>', 'Cover image, default is cover.jpg if exists'); +}; + var makeBuildFunc = function(converter) { return function(dir, options) { dir = dir || process.cwd(); @@ -31,7 +36,7 @@ var makeBuildFunc = function(converter) { }) ) .then(function(output) { - console.log("Successfuly built !"); + console.log("Successfully built!"); return output; }, utils.logError) .fail(function() { @@ -43,5 +48,6 @@ var makeBuildFunc = function(converter) { module.exports = { folder: makeBuildFunc(generate.folder), file: makeBuildFunc(generate.file), - command: buildCommand + command: buildCommand, + commandEbook: buildEbookCommand }; |