mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
32 lines
742 B
JavaScript
32 lines
742 B
JavaScript
var path = require("path");
|
|
var Q = require("q");
|
|
var fs = require("./fs");
|
|
|
|
var BaseGenerator = function(options) {
|
|
this.options = options;
|
|
};
|
|
|
|
BaseGenerator.prototype.convertFile = function(content, input) {
|
|
return Q.reject(new Error("Could not convert "+input));
|
|
};
|
|
|
|
BaseGenerator.prototype.transferFile = function(input) {
|
|
return fs.copy(
|
|
path.join(this.options.input, input),
|
|
path.join(this.options.output, input)
|
|
);
|
|
};
|
|
|
|
BaseGenerator.prototype.transferFolder = function(input) {
|
|
return fs.mkdirp(
|
|
path.join(this.options.output, input)
|
|
);
|
|
};
|
|
|
|
BaseGenerator.prototype.finish = function() {
|
|
return Q.reject(new Error("Could not finish generation"));
|
|
};
|
|
|
|
|
|
|
|
module.exports = BaseGenerator; |