Skip to content

Commit b01a018

Browse files
author
Vic-Nas
committed
Fixed item count
1 parent 4f93421 commit b01a018

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/build-index.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ jobs:
5252
if item.is_dir() and not item.name.startswith('.'):
5353
rel_path = str(item.relative_to(Path('.')))
5454
55+
item_has_files = has_files(item)
56+
5557
node = {
5658
'name': item.name,
5759
'path': rel_path,
5860
'type': 'dir',
59-
'has_files': has_files(item)
61+
'has_files': item_has_files
6062
}
6163
62-
# Recurse into subdirectories
63-
children = build_tree(item, rel_path + '/')
64-
if children:
65-
node['children'] = children
64+
# Only recurse if it doesn't have files (not a problem folder)
65+
if not item_has_files:
66+
children = build_tree(item, rel_path + '/')
67+
if children:
68+
node['children'] = children
6669
6770
items.append(node)
6871

0 commit comments

Comments
 (0)