Catch missing sync folder in getAllConfigFromFiles service
parent
567e29f3c9
commit
e62f440b65
|
@ -83,6 +83,10 @@ module.exports = {
|
||||||
* @returns {object} Object with key value pairs of configs.
|
* @returns {object} Object with key value pairs of configs.
|
||||||
*/
|
*/
|
||||||
getAllConfigFromFiles: async (configType = null) => {
|
getAllConfigFromFiles: async (configType = null) => {
|
||||||
|
if (!fs.existsSync(strapi.plugins['config-sync'].config.destination)) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const configFiles = fs.readdirSync(strapi.plugins['config-sync'].config.destination);
|
const configFiles = fs.readdirSync(strapi.plugins['config-sync'].config.destination);
|
||||||
|
|
||||||
const getConfigs = async () => {
|
const getConfigs = async () => {
|
||||||
|
|
Loading…
Reference in New Issue