From fd29170f765c7b5380e2b57c8c2c5c2e8d7922f4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 6 Feb 2020 11:51:39 -0800 Subject: [PATCH] Add duplicate_dirs.py. --- duplicate_dirs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 duplicate_dirs.py diff --git a/duplicate_dirs.py b/duplicate_dirs.py new file mode 100644 index 0000000..1e9cb8d --- /dev/null +++ b/duplicate_dirs.py @@ -0,0 +1,14 @@ +from voussoirkit import spinal + +basenames = {} + +walker = spinal.walk_generator('.', yield_directories=True, yield_files=False) +for directory in walker: + basenames.setdefault(directory.basename, []).append(directory) + +for (basename, dupes) in basenames.items(): + if len(dupes) == 1: + continue + for dupe in dupes: + print(dupe.absolute_path) + print()