diff --git a/services/core-store.js b/services/core-store.js index 0fb1916..64037ad 100644 --- a/services/core-store.js +++ b/services/core-store.js @@ -45,7 +45,7 @@ module.exports = { ) { await strapi.plugins['config-sync'].services.main.deleteConfigFile(configName); } else { - await strapi.plugins['config-sync'].services.main.writeConfigFile(configPrefix, currentConfig.key, currentConfig); + await strapi.plugins['config-sync'].services.main.writeConfigFile(configPrefix, currentConfig.key.replace('::', '##'), currentConfig); } })); }, diff --git a/services/main.js b/services/main.js index 9537d13..6d3ab29 100644 --- a/services/main.js +++ b/services/main.js @@ -22,9 +22,9 @@ module.exports = { const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configType}.${configName}`); if (shouldExclude) return; - // Check if the JSON content should be minified. - const json = - !strapi.plugins['config-sync'].config.minify ? + // Check if the JSON content should be minified. + const json = + !strapi.plugins['config-sync'].config.minify ? JSON.stringify(fileContents, null, 2) : JSON.stringify(fileContents); @@ -93,8 +93,8 @@ module.exports = { let fileConfigs = {}; await Promise.all(configFiles.map(async (file) => { - const type = file.split('.')[0]; // Grab the first part of the filename. - const name = file.split(/\.(.+)/)[1].split('.').slice(0, -1).join('.'); // Grab the rest of the filename minus the file extension. + const type = file.split('.')[0].replace('##', '::'); // Grab the first part of the filename. + const name = file.split(/\.(.+)/)[1].split('.').slice(0, -1).join('.').replace('##', '::'); // Grab the rest of the filename minus the file extension. if ( configType && configType !== type || @@ -201,6 +201,6 @@ module.exports = { * @returns {void} */ exportSingleConfig: async (configType, configName) => { - + }, };