A quick, and beautifull enhancement (;P) of a way that scaffold templates are generated. If 'YOUR_PROJECT/.templates' directory exists and template file exists inside, it will be used by scaffold generator instead of that default one from 'ejs-ext' templates directory.
exports.template = function (name) {
try {
stats = fs.lstatSync(process.cwd() + '/.templates/' + name + '.ejs');
if (stats.isFile()) {
return process.cwd() + '/.templates/' + name + '.ejs';
}
}
catch (e) {}
return __dirname + '/templates/' + name + '.ejs';
};
Sorry that it is not a pull request, but i was enlightened in some place, where i'm unabe to do that ;-)
A quick, and beautifull enhancement (;P) of a way that scaffold templates are generated. If 'YOUR_PROJECT/.templates' directory exists and template file exists inside, it will be used by scaffold generator instead of that default one from 'ejs-ext' templates directory.
Sorry that it is not a pull request, but i was enlightened in some place, where i'm unabe to do that ;-)