v1.18.x
barisusakli 9 years ago
parent 46de2ca134
commit 91efab3c6d

@ -21,10 +21,10 @@ Templates.compile = function(callback) {
if (nconf.get('isPrimary') === 'false' || fromFile.match('tpl')) { if (nconf.get('isPrimary') === 'false' || fromFile.match('tpl')) {
if (fromFile.match('tpl')) { if (fromFile.match('tpl')) {
emitter.emit('templates:compiled');
winston.info('[minifier] Compiling templates skipped'); winston.info('[minifier] Compiling templates skipped');
} }
emitter.emit('templates:compiled');
return callback(); return callback();
} }
@ -48,20 +48,28 @@ function getBaseTemplates(theme) {
} }
function preparePaths(baseTemplatesPaths, callback) { function preparePaths(baseTemplatesPaths, callback) {
var coreTemplatesPath = nconf.get('core_templates_path'), var coreTemplatesPath = nconf.get('core_templates_path');
viewsPath = nconf.get('views_dir'); var viewsPath = nconf.get('views_dir');
async.waterfall([ async.waterfall([
async.apply(plugins.fireHook, 'static:templates.precompile', {}), function (next) {
async.apply(plugins.getTemplates) rimraf(viewsPath, next);
},
function (next) {
mkdirp(viewsPath, next);
},
function(viewsPath, next) {
plugins.fireHook('static:templates.precompile', {}, next);
},
function(next) {
plugins.getTemplates(next);
}
], function(err, pluginTemplates) { ], function(err, pluginTemplates) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
winston.verbose('[meta/templates] Compiling templates'); winston.verbose('[meta/templates] Compiling templates');
rimraf.sync(viewsPath);
mkdirp.sync(viewsPath);
async.parallel({ async.parallel({
coreTpls: function(next) { coreTpls: function(next) {

Loading…
Cancel
Save