Merge pull request #38 from boazpoolman/feature/fix-import-on-bootstrap

fix: Code order in bootstrap function
pull/43/head
Boaz Poolman 2022-01-13 19:53:37 +01:00 committed by GitHub
commit a0b43f392a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -16,13 +16,6 @@ const defaultTypes = require('./config/types');
*/ */
module.exports = async () => { module.exports = async () => {
// Import on bootstrap.
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
await strapi.plugin('config-sync').service('main').importAllConfig();
}
}
// Register config types. // Register config types.
const registerTypes = () => { const registerTypes = () => {
const types = {}; const types = {};
@ -43,6 +36,13 @@ module.exports = async () => {
}; };
strapi.plugin('config-sync').types = registerTypes(); strapi.plugin('config-sync').types = registerTypes();
// Import on bootstrap.
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
await strapi.plugin('config-sync').service('main').importAllConfig();
}
}
// Register permission actions. // Register permission actions.
const actions = [ const actions = [
{ {