Skip to content
Snippets Groups Projects
Commit 4bba2bae authored by Dennis Baurichter's avatar Dennis Baurichter
Browse files

rename: Fix renaming files in current dir

Don't crash when renaming a file given without a path component (and
without options like -f).
parent 575fc435
No related branches found
No related tags found
No related merge requests found
......@@ -437,7 +437,9 @@ else:
continue
for src,dst in ops:
os.makedirs(os.path.dirname(dst), exist_ok=True)
dstdir=os.path.dirname(dst)
if dstdir:
os.makedirs(dstdir, exist_ok=True)
shutil.move(src,dst)
for src,dst,lnk in linkops:
os.remove(src)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment