-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.js
More file actions
53 lines (38 loc) · 1.24 KB
/
docs.js
File metadata and controls
53 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const fs = require('fs');
const appDirectory = __dirname + "/dist";
const fileName = appDirectory + "/LIST.md";
async function addToMd(title, dir)
{
const listDir = appDirectory + "/" + dir;
const content = await fs.readFileSync(fileName);
let newContent = "# " + title + "\n\n| Image | Path |\n| - | - |\n";
await fs.readdirSync(listDir).forEach(function(file)
{
newContent = newContent + "|  | " + file + " |\n";
});
newContent = newContent + "\n";
await fs.writeFileSync(fileName, content + newContent);
}
async function run()
{
// Remove file
await fs.writeFileSync(fileName, "## Credits\nAll images these are property of Clapfoot Inc.\n");
// Uniforms
await addToMd('Uniforms', "icons/uniforms");
// Items
await addToMd('Items', "icons/items");
// Map
await addToMd('Map', "icons/map");
// Menu
await addToMd('Menus', "icons/menus");
// Structures
await addToMd('Structuresenu', "icons/structures");
// Techtree
await addToMd('Techtree', "icons/techtree");
// Vehicles
await addToMd('Vehicles', "icons/vehicles");
// Hexagon map
await addToMd('Hexagon map', "maps/clasic");
}
// Run
run();