From f5b0bf8ffd8c646a2510bb9d63c886ef43af6d9e Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 1 Feb 2020 16:40:14 -0800 Subject: [PATCH] Reverse paths before renaming, let children of renamed dirs go first. This way, the parent directory is always after all of its children. --- brename.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brename.py b/brename.py index 0128e08..6e31a67 100644 --- a/brename.py +++ b/brename.py @@ -57,6 +57,7 @@ def brename(transformation, autoyes=False, recurse=False): print('Is this correct? y/n') ok = input('>').lower() in ('y', 'yes', 'yeehaw') + pairs = reversed(pairs) if ok: loop(pairs, dry=False)