mirror of
https://github.com/CIMEngine/MapList.git
synced 2024-11-21 19:26:22 +03:00
add external support
This commit is contained in:
parent
21492b5ed9
commit
7bb8c0ad32
2 changed files with 19 additions and 11 deletions
|
@ -4,4 +4,3 @@
|
|||
2. Virtual Governments - Map of Virtual Countries from OOVC organisation. ([vgovernments](https://cimengine.github.io/map/?id=vgovernments))
|
||||
3. International Virtual Countries - Map of International Virtual Countries (League of Virtual Nations). ([ivc](https://cimengine.github.io/map/?id=ivc))
|
||||
4. Political Map of Dusiburg - Политическая карта Дусибурской Республики ([dusiburg](https://cimengine.github.io/map/?id=dusiburg))
|
||||
5. `OVN` map - Map of Virtual Countries ([movc](https://cimengine.github.io/map/?id=movc))
|
||||
|
|
9
index.js
9
index.js
|
@ -1,5 +1,6 @@
|
|||
const fs = require("fs");
|
||||
|
||||
async function run() {
|
||||
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
|
||||
|
||||
let readme = "# CIMEngine map list\n\n";
|
||||
|
@ -7,9 +8,17 @@ let readme = "# CIM Engine 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();
|
||||
|
|
Loading…
Add table
Reference in a new issue