mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-22 22:13:20 +02:00
79a26180af
Some checks failed
Auto Test / auto-test (18, ARM64) (push) Has been cancelled
Auto Test / auto-test (18, macos-latest) (push) Has been cancelled
Auto Test / auto-test (18, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (18, windows-latest) (push) Has been cancelled
Auto Test / auto-test (20, ARM64) (push) Has been cancelled
Auto Test / auto-test (20, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (20, windows-latest) (push) Has been cancelled
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / check-linters (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
json-yaml-validate / json-yaml-validate (push) Has been cancelled
json-yaml-validate / check-lang-json (push) Has been cancelled
Automatically close stale issues / stale (push) Successful in 59s
28 lines
688 B
JavaScript
28 lines
688 B
JavaScript
// For #5231
|
|
|
|
const fs = require("fs");
|
|
|
|
let path = "./src/lang";
|
|
|
|
// list directories in the lang directory
|
|
let jsonFileList = fs.readdirSync(path);
|
|
|
|
for (let jsonFile of jsonFileList) {
|
|
if (!jsonFile.endsWith(".json")) {
|
|
continue;
|
|
}
|
|
|
|
let jsonPath = path + "/" + jsonFile;
|
|
let originalContent = fs.readFileSync(jsonPath, "utf8");
|
|
let langData = JSON.parse(originalContent);
|
|
|
|
let formattedContent = JSON.stringify(langData, null, 4) + "\n";
|
|
|
|
if (originalContent !== formattedContent) {
|
|
console.error(`File ${jsonFile} is not formatted correctly.`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
console.log("All lang json files are formatted correctly.");
|