spec.find_repo_root(start=None)
Walk up from start to the first directory that holds regen/architecture.toml.
Parameters
| start |
Path | str | None |
Directory to start from. Defaults to the current working directory. |
None |
Returns
| Path |
Path |
The repository root. |
Examples
from pathlib import Path
from tempfile import TemporaryDirectory
from spotregen import find_repo_root, make_sample_repo
with TemporaryDirectory() as tmp:
root = make_sample_repo(Path(tmp) / "demo")
print(find_repo_root(root / "src" / "samplepkg").name)