pkgs/clan/lib: Handle basecase of directory functionality

This commit is contained in:
a-kenji
2025-08-09 12:30:28 +02:00
parent cb8a01d448
commit eceb6eb999

View File

@@ -225,6 +225,10 @@ def get_clan_directories(flake: "Flake") -> tuple[str, str]:
root_path = Path(root_directory)
directory_path = Path(directory)
# No custom directory is set
if root_path == directory_path:
return (root_directory, "")
try:
relative_path = directory_path.relative_to(root_path)
return (root_directory, str(relative_path))