1 | ;
|
2 | var handlebars = require("handlebars");
|
3 | var fs = require("fs");
|
4 | exports.loadFromPath = function (filePath) {
|
5 | if (fs.existsSync(filePath)) {
|
6 | return fs.readFileSync(filePath, 'utf8');
|
7 | }
|
8 | else {
|
9 | throw new Error("Template file " + filePath + " does not exists!");
|
10 | }
|
11 | };
|
12 | exports.generateCode = function (compileContext, templatePath) {
|
13 | return handlebars.compile(exports.loadFromPath(templatePath))(compileContext);
|
14 | };
|
15 | //# sourceMappingURL=generator.js.map |
\ | No newline at end of file |