Let my HOME alone 1/2

This commit is contained in:
Geoffrey Frogeye 2019-04-25 22:54:51 +02:00
parent 2ae37e902e
commit a83e45df5e
94 changed files with 328 additions and 58 deletions

23
config/scripts/rmf Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
# Rename sync-conflict files to normal files
# WARNING Does not check for conclicts
import os
import re
for root, dirs, files in os.walk('.'):
for f in files:
if '.sync-conflict' not in f:
continue
nf = re.sub('.sync-conflict-\d{8}-\d{6}-\w{7}', '', f)
F = os.path.join(root, f)
NF = os.path.join(root, nf)
if os.path.exists(NF):
print(f"'{F}' → '{NF}': file already exists")
else:
print(f"'{F}' → '{NF}': done")
os.rename(F, NF)