summaryrefslogtreecommitdiffstats
path: root/lib/generate/generator.js
blob: 3fe080e90ae44e7fc20359ac2db3cbcf1d595f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;