Skip to content

Commit

Permalink
Merge pull request #651 from razzeee/format-exported-json
Browse files Browse the repository at this point in the history
Format json files on export
  • Loading branch information
razzeee authored Oct 31, 2023
2 parents ee63666 + 3c8fad4 commit 72c8b8b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/addon-parser/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function checkProvides(provider) {
}

function createAuthorNode(author) {
newauthor = JSON.parse(JSON.stringify(author));
newauthor = JSON.parse(JSON.stringify(author, null, 2));
authorcheck = authors.find(o => o.id === newauthor.name);
if (!authorcheck) {
newauthor.id = newauthor.name;
Expand All @@ -298,7 +298,7 @@ function createAuthorNode(author) {
}

function createCategoryNode(category) {
newcategory = JSON.parse(JSON.stringify(category));
newcategory = JSON.parse(JSON.stringify(category, null, 2));
categorycheck = categories.find(o => o.id === newcategory.name);
if (!categorycheck) {
newcategory.id = newcategory.name;
Expand Down Expand Up @@ -521,11 +521,14 @@ async function app() {
}
}
console.log("writing addons.json to " + pixiememory);
fs.writeFileSync(pixiememory + "addons.json", JSON.stringify(addons));
fs.writeFileSync(pixiememory + "addons.json", JSON.stringify(addons, null, 2));
console.log("writing authors.json to " + pixiememory);
fs.writeFileSync(pixiememory + "authors.json", JSON.stringify(authors));
fs.writeFileSync(pixiememory + "authors.json", JSON.stringify(authors, null, 2));
console.log("writing categories.json to " + pixiememory);
fs.writeFileSync(pixiememory + "categories.json", JSON.stringify(categories));
fs.writeFileSync(
pixiememory + "categories.json",
JSON.stringify(categories, null, 2)
);
if (args["getstats"]) {
let stats = "";
let gitHubCommits = "0";
Expand Down

0 comments on commit 72c8b8b

Please sign in to comment.