cmd/duplicate_dirs.py

15 lines
364 B
Python
Raw Normal View History

2020-02-06 19:51:39 +00:00
from voussoirkit import spinal
basenames = {}
walker = spinal.walk('.', yield_directories=True, yield_files=False)
2020-02-06 19:51:39 +00:00
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()