-
-
Notifications
You must be signed in to change notification settings - Fork 660
Expand file tree
/
Copy pathprint-config-tree
More file actions
executable file
·34 lines (28 loc) · 850 Bytes
/
print-config-tree
File metadata and controls
executable file
·34 lines (28 loc) · 850 Bytes
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
#!/usr/bin/env node
const actions = require('./generate-config-tree');
const { tree, TAG_BONUS, TAG_CORE } = actions;
const { [TAG_BONUS]: __bonus, [TAG_CORE]: __core, ...track } = tree;
function printLn(line) {
process.stdout.write(`${line}\n`);
}
function printList(items) {
items.forEach((item) => {
printLn(`- ${item.slug} (${item.difficulty})`);
});
}
printLn('Core (matches config.json) of this track:');
printList(__core);
printLn('\n');
printLn('core');
printLn('----');
Object.keys(track).forEach((slug) => {
printLn(`├─ ${slug}`);
track[slug].forEach((side, index, self) => {
junction = index === self.length - 1 ? '└─' : '├─';
printLn(`│ ${junction} ${side.slug} (${side.difficulty})`);
});
printLn('│');
});
printLn('bonus');
printLn('----');
printList(__bonus);