Not allowed to actually do it

This commit is contained in:
2026-02-05 17:30:44 +00:00
parent 76f48fa288
commit 2fa8a7872e
5 changed files with 58 additions and 0 deletions

16
scripts/parse-maps.js Normal file
View File

@@ -0,0 +1,16 @@
import yaml from 'js-yaml';
import fs from 'fs';
import path from 'path';
const inputDir = '../static/mapFiles/yaml';
const outputDir = '../static/mapFiles/json';
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, {recursive: true});
fs.readdirSync(inputDir).forEach(file => {
if (file.endsWith('.yaml')) {
const content = yaml.load(fs.readFileSync(path.join(inputDir, file), 'utf8'));
const fileName = file.replace('.yaml', '.json');
fs.writeFileSync(path.join(outputDir, fileName), JSON.stringify(content));
}
})