mirror of
https://github.com/CIMEngine/MapList.git
synced 2024-10-05 06:35:57 +03:00
24 lines
533 B
JavaScript
24 lines
533 B
JavaScript
const fs = require("fs");
|
|
|
|
async function run() {
|
|
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
|
|
|
|
let readme = "# CIMEngine map list\n\n";
|
|
|
|
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);
|
|
}
|
|
|
|
run();
|