mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.198.1
This commit is contained in:
26
test/test-language-fonts.js
Normal file
26
test/test-language-fonts.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import * as fs from "fs";
|
||||
import * as ut from "../node/util.js";
|
||||
|
||||
async function main () {
|
||||
console.log(`##### Validating language fonts #####`);
|
||||
|
||||
const json = ut.readJson("./data/languages.json");
|
||||
const errors = [];
|
||||
|
||||
json.languageScript.forEach(lang => {
|
||||
if (!lang.fonts?.length) return;
|
||||
|
||||
lang.fonts
|
||||
.filter(path => !fs.existsSync(path))
|
||||
.forEach(path => errors.push(`languageScript "${lang.name}" font path "${path}" does not exist!`));
|
||||
});
|
||||
|
||||
if (errors.length) {
|
||||
errors.forEach(err => console.error(`\t${err}`));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export default main();
|
||||
Reference in New Issue
Block a user