Skip to content

Commit 6821110

Browse files
committed
feat: don't importOnBootstrap when using the config-sync CLI to start Strapi
1 parent 0f52704 commit 6821110

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

server/bootstrap.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ module.exports = async () => {
5050
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
5151
if (strapi.server.app.env === 'development') {
5252
strapi.log.warn(logMessage(`You can't use the 'importOnBootstrap' setting in the development env.`));
53+
} else if (process.env.CONFIG_SYNC_CLI === true) {
54+
strapi.log.warn(logMessage(`The 'importOnBootstrap' setting was ignored because Strapi was started from the config-sync CLI itself.`));
5355
} else if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
5456
await strapi.plugin('config-sync').service('main').importAllConfig();
5557
}

server/cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const packageJSON = require('../package.json');
1515
const program = new Command();
1616

1717
const getStrapiApp = async () => {
18+
process.env.CONFIG_SYNC_CLI = true;
19+
1820
try {
1921
const tsUtils = require('@strapi/typescript-utils'); // eslint-disable-line
2022

0 commit comments

Comments
 (0)