Add beautify setting for the json exports
parent
2535d76909
commit
e4b5c1d0f9
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"destination": "extensions/config/files/",
|
"destination": "extensions/config/files/",
|
||||||
|
"beautify": true,
|
||||||
"exclude": []
|
"exclude": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,15 @@ const util = require('util');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
writeConfigFile: async (configName, fileContents) => {
|
writeConfigFile: async (configName, fileContents) => {
|
||||||
|
const json =
|
||||||
|
strapi.plugins.config.config.beautify ?
|
||||||
|
JSON.stringify(JSON.parse(fileContents), null, 2)
|
||||||
|
: fileContents;
|
||||||
|
|
||||||
await strapi.fs.writePluginFile(
|
await strapi.fs.writePluginFile(
|
||||||
'config',
|
'config',
|
||||||
`files/${configName}.json`,
|
`files/${configName}.json`,
|
||||||
fileContents
|
json
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue