diff --git a/sync.py b/sync.py index ad5e83a..255e47a 100755 --- a/sync.py +++ b/sync.py @@ -28,6 +28,7 @@ class DiffStatus(Enum): UNEXPECTED_SYMLINK = auto() CONTENT_DIFFERS = auto() SYMLINK_DIFFERS = auto() + UNEXPECTED_DIRECTORY = auto() class FileDiff(NamedTuple): @@ -90,6 +91,9 @@ def compare_files(dot_file: Path, sys_file: Path) -> DiffStatus: elif sys_file.is_symlink(): return DiffStatus.UNEXPECTED_SYMLINK + if sys_file.is_dir(): + return DiffStatus.UNEXPECTED_DIRECTORY + try: if file_sum(dot_file) == file_sum(sys_file): return DiffStatus.MATCH