@@ -18,11 +18,11 @@ module.exports = {
1818 const coreStore = await coreStoreAPI . find ( { _limit : - 1 } ) ;
1919
2020 Object . values ( coreStore ) . map ( async ( { key, value } ) => {
21- await strapi . plugins . config . services . config . writeConfigFile ( key , value ) ;
21+ await strapi . plugins [ ' config-sync' ] . services . config . writeConfigFile ( key , value ) ;
2222 } ) ;
2323
2424 ctx . send ( {
25- message : `Config was successfully exported to ${ strapi . plugins . config . config . destination } .`
25+ message : `Config was successfully exported to ${ strapi . plugins [ ' config-sync' ] . config . destination } .`
2626 } ) ;
2727 } ,
2828
@@ -34,18 +34,18 @@ module.exports = {
3434 */
3535 import : async ( ctx ) => {
3636 // Check for existance of the config file destination dir.
37- if ( ! fs . existsSync ( strapi . plugins . config . config . destination ) ) {
37+ if ( ! fs . existsSync ( strapi . plugins [ ' config-sync' ] . config . destination ) ) {
3838 ctx . send ( {
3939 message : 'No config files were found.'
4040 } ) ;
4141
4242 return ;
4343 }
4444
45- const configFiles = fs . readdirSync ( strapi . plugins . config . config . destination ) ;
45+ const configFiles = fs . readdirSync ( strapi . plugins [ ' config-sync' ] . config . destination ) ;
4646
4747 configFiles . map ( ( file ) => {
48- strapi . plugins . config . services . config . importFromFile ( file . slice ( 0 , - 5 ) ) ;
48+ strapi . plugins [ ' config-sync' ] . services . config . importFromFile ( file . slice ( 0 , - 5 ) ) ;
4949 } ) ;
5050
5151 ctx . send ( {
@@ -61,21 +61,21 @@ module.exports = {
6161 */
6262 getConfigsFromFiles : async ( ctx ) => {
6363 // Check for existance of the config file destination dir.
64- if ( ! fs . existsSync ( strapi . plugins . config . config . destination ) ) {
64+ if ( ! fs . existsSync ( strapi . plugins [ ' config-sync' ] . config . destination ) ) {
6565 ctx . send ( {
6666 message : 'No config files were found.'
6767 } ) ;
6868
6969 return ;
7070 }
7171
72- const configFiles = fs . readdirSync ( strapi . plugins . config . config . destination ) ;
72+ const configFiles = fs . readdirSync ( strapi . plugins [ ' config-sync' ] . config . destination ) ;
7373 let formattedConfigs = { } ;
7474
7575 const getConfigs = async ( ) => {
7676 return Promise . all ( configFiles . map ( async ( file ) => {
7777 const formattedConfigName = file . slice ( 0 , - 5 ) ; // remove the .json extension.
78- const fileContents = await strapi . plugins . config . services . config . readConfigFile ( formattedConfigName ) ;
78+ const fileContents = await strapi . plugins [ ' config-sync' ] . services . config . readConfigFile ( formattedConfigName ) ;
7979 formattedConfigs [ formattedConfigName ] = fileContents ;
8080 } ) ) ;
8181 } ;
0 commit comments