diff --git a/README.md b/README.md index 3873bbe..cf27b25 100644 --- a/README.md +++ b/README.md @@ -346,7 +346,7 @@ When enabled all the exported JSON files will be minified. ### Import on bootstrap -Allows you to let the config be imported automaticly when strapi is bootstrapping (on `strapi start`). This setting should never be used locally and should be handled very carefully as it can unintendedly overwrite the changes in your database. **PLEASE USE WITH CARE**. +Allows you to let the config be imported automaticly when strapi is bootstrapping (on `strapi start`). This setting can't be used locally and should be handled very carefully as it can unintendedly overwrite the changes in your database. **PLEASE USE WITH CARE**. ###### Key: `importOnBootstrap` diff --git a/server/bootstrap.js b/server/bootstrap.js index 223cb1f..88743ae 100644 --- a/server/bootstrap.js +++ b/server/bootstrap.js @@ -4,6 +4,7 @@ const fs = require('fs'); const ConfigType = require('./config/type'); const defaultTypes = require('./config/types'); +const { logMessage } = require('./utils'); /** * An asynchronous bootstrap function that runs before @@ -38,6 +39,10 @@ module.exports = async () => { // Import on bootstrap. if (strapi.config.get('plugin.config-sync.importOnBootstrap')) { + if (strapi.server.app.env === 'development') { + strapi.log.warn(logMessage(`You can't use the 'importOnBootstrap' setting in the development env.`)); + return; + } if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) { await strapi.plugin('config-sync').service('main').importAllConfig(); }