diff --git a/sync b/sync index 5f38d3e..beed8d9 100755 --- a/sync +++ b/sync @@ -11,6 +11,7 @@ class SyncStatus: DIFF = 2 SRC_MISSING = 3 DEST_MISSING = 4 + BOTH_MISSING = 5 # https://stackoverflow.com/a/287944 @@ -93,7 +94,9 @@ def get_sync_status(fd: tuple[str, str]) -> SyncStatus: return True return any([has_differences(subdcmp) for subdcmp in dcmp.subdirs.values()]) - if not os.path.exists(f1): + if not (os.path.exists(f1) or os.path.exists(f2)): + return SyncStatus.BOTH_MISSING + elif not os.path.exists(f1): return SyncStatus.SRC_MISSING elif not os.path.exists(f2): return SyncStatus.DEST_MISSING @@ -122,6 +125,8 @@ def list_files(reverse: bool = False) -> list[int]: elif status == SyncStatus.DEST_MISSING: f1_c = bcolors.RED if reverse else f1_c f2_c = bcolors.RED if not reverse else f2_c + elif status == SyncStatus.BOTH_MISSING: + f1_c, f2_c = bcolors.RED, bcolors.RED print( f"{bcolors.PURPLE}{i} {f1_c}{f[int(reverse)]} {bcolors.ENDC}-> {f2_c}{f[int(not reverse)]}{bcolors.ENDC}"