Let my HOME alone 1/2
This commit is contained in:
parent
2ae37e902e
commit
a83e45df5e
94 changed files with 328 additions and 58 deletions
23
config/scripts/rmf
Executable file
23
config/scripts/rmf
Executable 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)
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue