Check if the path is an AstrBot root directory
(path: str | Path)
| 7 | |
| 8 | |
| 9 | def check_astrbot_root(path: str | Path) -> bool: |
| 10 | """Check if the path is an AstrBot root directory""" |
| 11 | if not isinstance(path, Path): |
| 12 | path = Path(path) |
| 13 | if not path.exists() or not path.is_dir(): |
| 14 | return False |
| 15 | if not (path / ".astrbot").exists(): |
| 16 | return False |
| 17 | return True |
| 18 | |
| 19 | |
| 20 | def get_astrbot_root() -> Path: |
no outgoing calls
no test coverage detected