From 6821110d7e68131d066e6781294df82378dfbebd Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Thu, 18 Apr 2024 21:21:32 +0200 Subject: [PATCH 1/4] feat: don't importOnBootstrap when using the config-sync CLI to start Strapi --- server/bootstrap.js | 2 ++ server/cli.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/server/bootstrap.js b/server/bootstrap.js index 2f88ee4..ddddf3a 100644 --- a/server/bootstrap.js +++ b/server/bootstrap.js @@ -50,6 +50,8 @@ module.exports = async () => { 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.`)); + } else if (process.env.CONFIG_SYNC_CLI === true) { + strapi.log.warn(logMessage(`The 'importOnBootstrap' setting was ignored because Strapi was started from the config-sync CLI itself.`)); } else if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) { await strapi.plugin('config-sync').service('main').importAllConfig(); } diff --git a/server/cli.js b/server/cli.js index 22b90c7..6f3d2e2 100644 --- a/server/cli.js +++ b/server/cli.js @@ -15,6 +15,8 @@ const packageJSON = require('../package.json'); const program = new Command(); const getStrapiApp = async () => { + process.env.CONFIG_SYNC_CLI = true; + try { const tsUtils = require('@strapi/typescript-utils'); // eslint-disable-line From e06ed0b9683115e8f6bef5ff993a0b98fb6458b7 Mon Sep 17 00:00:00 2001 From: boazpoolman Date: Thu, 18 Apr 2024 20:36:03 +0000 Subject: [PATCH 2/4] chore: Bump version to 1.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9cb352..2761569 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-config-sync", - "version": "1.2.3", + "version": "1.2.4", "description": "Migrate your config data across environments using the CLI or Strapi admin panel.", "strapi": { "displayName": "Config Sync", From 769e2c3be301a421bdc9bced0f5a542570c76d1f Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Thu, 18 Apr 2024 23:09:12 +0200 Subject: [PATCH 3/4] fix: check for process.env.CONFIG_SYNC_CLI with 'true' instead of true --- server/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/bootstrap.js b/server/bootstrap.js index ddddf3a..dce364f 100644 --- a/server/bootstrap.js +++ b/server/bootstrap.js @@ -50,7 +50,7 @@ module.exports = async () => { 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.`)); - } else if (process.env.CONFIG_SYNC_CLI === true) { + } else if (process.env.CONFIG_SYNC_CLI === 'true') { strapi.log.warn(logMessage(`The 'importOnBootstrap' setting was ignored because Strapi was started from the config-sync CLI itself.`)); } else if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) { await strapi.plugin('config-sync').service('main').importAllConfig(); From f8631f9685851494e2abbb79dee468dee40c1769 Mon Sep 17 00:00:00 2001 From: boazpoolman Date: Thu, 18 Apr 2024 21:12:12 +0000 Subject: [PATCH 4/4] chore: Bump version to 1.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2761569..8161410 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-config-sync", - "version": "1.2.4", + "version": "1.2.5", "description": "Migrate your config data across environments using the CLI or Strapi admin panel.", "strapi": { "displayName": "Config Sync",