Skip to content

Commit

Permalink
Completely remove dontFlattenConfig option.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Sep 30, 2016
1 parent d5ba8e8 commit 56c9b5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
6 changes: 3 additions & 3 deletions lib/hooks/moduleloader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ module.exports = function(sails) {
exclude : ['locales'].concat(_.map(sails.config.moduleloader.configExt, function (extension){ return 'local.'+extension; })),
excludeDirs: /(locales|env)$/,
filter : new RegExp('(.+)\\.(' + sails.config.moduleloader.configExt.join('|') + ')$'),
flatten: !(sails.config.dontFlattenConfig),
flatten : true,
identity : false
}, cb);
},
Expand All @@ -271,7 +271,7 @@ module.exports = function(sails) {
dirname : path.resolve( sails.config.paths.config || path.resolve(sails.config.appPath, 'config'), 'env', env ),
filter : new RegExp('(.+)\\.(' + sails.config.moduleloader.configExt.join('|') + ')$'),
optional : true,
flatten: !(sails.config.dontFlattenConfig),
flatten : true,
identity : false
}, cb);
}],
Expand All @@ -286,7 +286,7 @@ module.exports = function(sails) {
dirname : path.resolve( sails.config.paths.config || path.resolve(sails.config.appPath, 'config'), 'env' ),
filter : new RegExp('^' + env + '\\.(' + sails.config.moduleloader.configExt.join('|') + ')$'),
optional : true,
flatten: !(sails.config.dontFlattenConfig),
flatten : true,
identity : false
}, cb);
}]
Expand Down
23 changes: 0 additions & 23 deletions test/integration/hook.userconfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,6 @@ describe('hooks :: ', function() {

});

describe('with \'dontFlattenConfig\' true', function() {

var sailsApp;
it('should use filenames in subfolders as keys', function(done) {

sailsApp = Sails();
sailsApp.load({hooks:{grunt:false}, dontFlattenConfig: true}, function(err, sails) {
if (err) { return callback(err); }
assert.equal(sails.config.foo, 'goo');
assert.equal(sails.config.bar.foo, 'bar');
assert.equal(sails.config.bar.abc, 123);
assert.equal(typeof(sails.config.abc), 'undefined');
return done();
});

});

after(function (done){
sailsApp.lower(done);
});

});

describe('in development environment', function() {

var sails;
Expand Down

0 comments on commit 56c9b5b

Please sign in to comment.