mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
27 lines
587 B
JavaScript
27 lines
587 B
JavaScript
import 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();
|