Skip to content
Snippets Groups Projects
Verified Commit 5aa5be03 authored by David Beniamine's avatar David Beniamine
Browse files

Sort files in reverse order

We need subdirs to be rename before their parents, sorting files in
reverse order fix this
parent 705ab6da
Branches
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ def rename(base, path, dry_run, occ_path, user, php):
cmd = ['find', '{}/{}'.format(base, path), '-regex', '.*/.*\s$']
r = run(cmd, capture_output=True)
files = r.stdout.decode('utf-8').split('\n')[:-1]
files.sort(reverse=True)
# Rename files and collect directories to scan
for f in files:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment