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