summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech@siewierski.eu>2019-12-28 01:35:12 +0100
committerWojciech Siewierski <wojciech@siewierski.eu>2019-12-28 01:39:58 +0100
commit0c4b97aec363443024a02eba02ee42f0b456d719 (patch)
tree98aaca754a10c90c66d732105cd29152264351c3
parent9136820e615429d48bfd71225c96975dcfad8990 (diff)
downloadranger-0c4b97aec363443024a02eba02ee42f0b456d719.tar.gz
bulkrename: Don't create empty mkdir calls
basepath being any false-like value (None and '' in this case) should
warrant skipping a mkdir call creation, not just None.

The (broken) mkdir calls were created even for trivial renames inside
a single directory.

Improves upon #1342.
-rwxr-xr-xranger/config/commands.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 17a0fa9c..651b2640 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -1162,7 +1162,7 @@ class bulkrename(Command):
         for old, new in zip(filenames, new_filenames):
             if old != new:
                 basepath, _ = os.path.split(new)
-                if (basepath is not None and basepath not in new_dirs
+                if (basepath and basepath not in new_dirs
                         and not os.path.isdir(basepath)):
                     script_lines.append("mkdir -vp -- {dir}".format(
                         dir=esc(basepath)))