feat: don't importOnBootstrap when using the config-sync CLI to start Strapi
parent
0f527048cc
commit
6821110d7e
|
@ -50,6 +50,8 @@ module.exports = async () => {
|
||||||
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
|
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
|
||||||
if (strapi.server.app.env === 'development') {
|
if (strapi.server.app.env === 'development') {
|
||||||
strapi.log.warn(logMessage(`You can't use the 'importOnBootstrap' setting in the development env.`));
|
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'))) {
|
} else if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
|
||||||
await strapi.plugin('config-sync').service('main').importAllConfig();
|
await strapi.plugin('config-sync').service('main').importAllConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ const packageJSON = require('../package.json');
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
|
|
||||||
const getStrapiApp = async () => {
|
const getStrapiApp = async () => {
|
||||||
|
process.env.CONFIG_SYNC_CLI = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const tsUtils = require('@strapi/typescript-utils'); // eslint-disable-line
|
const tsUtils = require('@strapi/typescript-utils'); // eslint-disable-line
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue