Skip to content

Commit

Permalink
feat: add repo list to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
aleneum committed Dec 17, 2024
1 parent 29dc25e commit fce9eaf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hive_cli/styling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from pathlib import Path


HEADER_STYLE = "text-lg"
WARNING_STYLE = (
"bg-rose-500 text-white py-2 px-4 rounded-lg text-center text-lg font-bold"
Expand Down Expand Up @@ -30,3 +33,15 @@
</defs>
</svg>
"""



def list_files(startpath: Path) -> list[tuple[int, str]]:
out = []
for root, _, files in startpath.walk():
if any(p.startswith(".git") or p.startswith("__") for p in root.parts):
continue
level = root.relative_to(startpath).parts.__len__()
out.append((level, root.name))
out.extend([(level + 1, f) for f in files])
return out

0 comments on commit fce9eaf

Please sign in to comment.