Merge pull request #16 from alexzrp/master

Added replace by double-colon in filename
pull/13/head
Boaz Poolman 2021-10-13 17:23:00 +02:00 committed by GitHub
commit 86b6c8e70f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ module.exports = {
) { ) {
await strapi.plugins['config-sync'].services.main.deleteConfigFile(configName); await strapi.plugins['config-sync'].services.main.deleteConfigFile(configName);
} else { } 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);
} }
})); }));
}, },

View File

@ -93,8 +93,8 @@ module.exports = {
let fileConfigs = {}; let fileConfigs = {};
await Promise.all(configFiles.map(async (file) => { await Promise.all(configFiles.map(async (file) => {
const type = file.split('.')[0]; // Grab the first part of the filename. const type = file.split('.')[0].replace('##', '::'); // 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 name = file.split(/\.(.+)/)[1].split('.').slice(0, -1).join('.').replace('##', '::'); // Grab the rest of the filename minus the file extension.
if ( if (
configType && configType !== type || configType && configType !== type ||