From ad63d5692a8caa46d299df0b1a733bd56478e7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Mon, 23 Dec 2024 16:18:24 +0100 Subject: [PATCH] Addressing comments --- buildtools/sanitize_translations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildtools/sanitize_translations.js b/buildtools/sanitize_translations.js index 9459631cb1..874c7392f3 100644 --- a/buildtools/sanitize_translations.js +++ b/buildtools/sanitize_translations.js @@ -21,9 +21,9 @@ const fileStream = fs.readdirSync(directoryPath) // Make sure it's a file .filter((file) => fs.lstatSync(file).isFile()) // Make sure it is json file - .filter((file) => file.endsWith(".json")) + .filter((file) => file.endsWith(".json")) // Read the contents and put it into an array [path, json] - .map((file) => [file, JSON.parse(fs.readFileSync(file, "utf8"))]); + .map((file) => [file, JSON.parse(fs.readFileSync(file, "utf8"))]); console.debug(`Found ${fileStream.length} files to sanitize`); @@ -40,7 +40,7 @@ console.debug(`Found ${onlyDifferent.length} files that need sanitizing`); // Write the sanitized json back to the files onlyDifferent.forEach(([file, json, sanitizedJson]) => { console.info(`Sanitizing ${file}`); - fs.writeFileSync(file, JSON.stringify(sanitizedJson, null, 2)); + fs.writeFileSync(file, JSON.stringify(sanitizedJson, null, 4) + "\n"); }); console.info("Sanitization complete");