fix: try underscore variant when dash-slug path not found on disk

This commit is contained in:
Vadym Samoilenko 2026-03-26 15:23:03 +00:00
parent dd902ebb61
commit 015c5efbbd

View file

@ -306,6 +306,10 @@ def _infer_repo_path(folder_name: str) -> Path | None:
direct = Path(ROOT_PATH) / slug
if direct.exists() and direct.is_dir():
return direct
# Some repos use underscores where the slug has dashes
direct_underscore = Path(ROOT_PATH) / slug.replace("-", "_")
if direct_underscore.exists() and direct_underscore.is_dir():
return direct_underscore
# Fallback: walk up from the heuristic slash-replaced path
path_str = "/" + folder_name.lstrip("-").replace("-", "/")
p = Path(path_str)