mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Remove deprecated messy config solution for Waterline
This commit is contained in:
parent
88eb7fe54c
commit
1d1cba79a5
@ -5,7 +5,6 @@
|
||||
*/
|
||||
|
||||
// Node.js core.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Public node modules.
|
||||
@ -105,7 +104,7 @@ module.exports = function (strapi) {
|
||||
config['config/functions/*']
|
||||
);
|
||||
|
||||
// Remove cache
|
||||
// Remove cache.
|
||||
delete require.cache[path.resolve(strapi.config.appPath, 'package.json')];
|
||||
|
||||
// Local `package.json`.
|
||||
@ -126,15 +125,6 @@ module.exports = function (strapi) {
|
||||
});
|
||||
}
|
||||
|
||||
// Make sure the ORM config are equals to the databases file
|
||||
// (aiming to not have issue with adapters when rebuilding the dictionary).
|
||||
// It's kind of messy, for now, but it works fine. If someone has a better
|
||||
// solution we'd be glad to accept a Pull Request.
|
||||
if (!strapi.config.dry) {
|
||||
const ormConfig = JSON.parse(fs.readFileSync(path.resolve(strapi.config.appPath, strapi.config.paths.config, 'environments', strapi.config.environment, 'databases.json')));
|
||||
strapi.config.orm = ormConfig.orm;
|
||||
}
|
||||
|
||||
// Save different environments because we need it in the Strapi Studio.
|
||||
strapi.config.environments = config['config/environments/**'] || {};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user