move emailsPath to function

This commit is contained in:
Barış Soner Uşaklı
2018-03-16 11:26:16 -04:00
parent 29a3d8bd53
commit 8b615c64fa

View File

@@ -33,9 +33,9 @@ Emailer.transports = {
var app; var app;
var viewsDir = nconf.get('views_dir'); var viewsDir = nconf.get('views_dir');
var emailsPath = path.join(viewsDir, 'emails');
Emailer.getTemplates = function (config, cb) { Emailer.getTemplates = function (config, cb) {
var emailsPath = path.join(viewsDir, 'emails');
async.waterfall([ async.waterfall([
function (next) { function (next) {
file.walk(emailsPath, next); file.walk(emailsPath, next);