Use destination setting for writing files
parent
6efa4443ba
commit
75bcb74bb4
|
@ -19,11 +19,13 @@ module.exports = {
|
|||
JSON.stringify(JSON.parse(fileContents), null, 2)
|
||||
: fileContents;
|
||||
|
||||
await strapi.fs.writePluginFile(
|
||||
'config',
|
||||
`files/${configName}.json`,
|
||||
json
|
||||
);
|
||||
// Create the export folder if it does not yet exist.
|
||||
if (!fs.existsSync(strapi.plugins.config.config.destination)) {
|
||||
fs.mkdirSync(strapi.plugins.config.config.destination, { recursive: true });
|
||||
}
|
||||
|
||||
const writeFile = util.promisify(fs.writeFile);
|
||||
await writeFile(`${strapi.plugins.config.config.destination}${configName}.json`, json);
|
||||
},
|
||||
|
||||
readConfigFile: async (configName) => {
|
||||
|
|
Loading…
Reference in New Issue