Skip to content

Commit aa3fdf0

Browse files
committed
Fix os path split
1 parent 6613d3f commit aa3fdf0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/github_index/project_pages.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import urllib
5+
from pathlib import Path
56
from typing import Any, Callable
67

78
import tqdm
@@ -10,6 +11,10 @@
1011
from github_index.badge import generate_badges
1112

1213

14+
def split_path(path):
15+
return list(Path(path).parts)
16+
17+
1318
def get_repository_paths(data_path: str) -> list[str]:
1419
return glob.glob(os.path.join(
1520
data_path, "auto_generated", "repository", "*.json"))
@@ -104,7 +109,7 @@ def generate_readme(preamble: str, page_src_path: str, org_name: str) -> str:
104109
page_src_path, "repositories", "*", "*.md"), recursive=True)
105110
groups = {}
106111
for path in paths:
107-
group = path.split("\\")[-2]
112+
group = split_path(path)[-2]
108113

109114
if group not in groups:
110115
groups[group] = []

0 commit comments

Comments
 (0)