MapList/index.js

25 lines
533 B
JavaScript
Raw Normal View History

2023-06-11 09:31:32 +03:00
const fs = require("fs");
2024-01-23 21:09:44 +03:00
async function run() {
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
2023-06-11 09:31:32 +03:00
2024-01-23 21:09:44 +03:00
let readme = "# CIMEngine map list\n\n";
2023-06-11 09:31:32 +03:00
2024-01-23 21:09:44 +03:00
let k = 1;
for (let id in index) {
let item = index[id];
if (item.external) {
item = await (await fetch(item.external)).json();
}
readme += `${k++}. ${item.name} ${
item.description ? `- ${item.description}` : ""
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n`;
}
fs.writeFileSync("./README.md", readme);
2023-06-11 09:31:32 +03:00
}
2024-01-23 21:09:44 +03:00
run();