Skip to content

Commit b221bfc

Browse files
committed
feat: region list
1 parent d77f6c3 commit b221bfc

File tree

5 files changed

+53868
-53558
lines changed

5 files changed

+53868
-53558
lines changed

get_files.mjs renamed to gen_files.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ function generateHierarchy(basePath) {
1010
regions.forEach(region => {
1111
const regionPath = path.join(basePath, region);
1212
if (fs.statSync(regionPath).isDirectory()) {
13-
hierarchy[region] = {};
13+
const regionObj = {
14+
rooms: {},
15+
data: JSON5.parse(fs.readFileSync(path.join(regionPath, 'data.json'), 'utf8')),
16+
}
17+
hierarchy[region] = regionObj
1418

1519
const rooms = fs.readdirSync(regionPath);
1620
rooms.forEach(room => {
@@ -30,7 +34,7 @@ function generateHierarchy(basePath) {
3034
const screens = fs.readdirSync(roomPath)
3135
.filter(file => file !== 'data.json' && fs.statSync(path.join(roomPath, file)).isFile());
3236

33-
hierarchy[region][room] = { screens, data };
37+
regionObj.rooms[room] = { screens, data };
3438
}
3539
});
3640
}

0 commit comments

Comments
 (0)