summaryrefslogtreecommitdiffstats
path: root/bin/build.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/build.js')
-rw-r--r--bin/build.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/bin/build.js b/bin/build.js
deleted file mode 100644
index 28d7641..0000000
--- a/bin/build.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var path = require('path');
-var Q = require('q');
-var _ = require('lodash');
-var fs = require('fs');
-
-var utils = require('./utils');
-var generate = require("../lib/generate");
-var parse = require("../lib/parse");
-var generators = require("../lib/generate").generators;
-
-var buildCommand = function(command) {
- return command
- .option('-v, --verbose', 'Activate verbose mode, useful for debugging errors')
- .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, 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();
- outputDir = options.output;
-
- // Set debugging
- if(options.verbose) {
- process.env.DEBUG = "true";
- }
-
- console.log('Starting build ...');
- return converter(
- _.extend({}, options || {}, {
- input: dir,
- output: outputDir,
- generator: options.format,
- configFile: options.config
- })
- )
- .then(function(output) {
- console.log("Successfully built!");
- return output;
- });
- };
-};
-
-module.exports = {
- folder: makeBuildFunc(generate.folder),
- file: makeBuildFunc(generate.file),
- command: buildCommand,
- commandEbook: buildEbookCommand
-};