Skip to content

Commit

Permalink
get rid of warn in configure.js when using ractive engine with layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sleewoo committed Jan 5, 2015
1 parent 2fa574e commit e7d864a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/hooks/views/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ module.exports = function configure ( sails ) {
sails.config.views.layout = 'layout.' + sails.config.views.engine.ext;
}

if ( engineName !== 'ejs' && engineName !== 'handlebars' && sails.config.views.layout ) {
sails.log.warn('Sails\' built-in layout support only works with the `ejs` and `handlebars` view engines.');
var layoutableEngines = [
'ejs',
'handlebars',
'ractive'
];
if ( sails.config.views.layout && layoutableEngines.indexOf(engineName) >= 0 ) {
sails.log.warn('Sails\' built-in layout support only works with the `' +
layoutableEngines.join('`, `') + '` view engines.');
sails.log.warn('You\'re using `'+ engineName +'`.');
sails.log.warn('Ignoring `sails.config.views.layout`...');
}
Expand Down

0 comments on commit e7d864a

Please sign in to comment.