Move scripts dir inside hm
And remove weird path contraptions
This commit is contained in:
parent
050901da2f
commit
edeef96133
49 changed files with 2 additions and 11 deletions
21
hm/scripts/syncthingRestore
Executable file
21
hm/scripts/syncthingRestore
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 --pure
|
||||
#! nix-shell -p python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
curDir = os.path.realpath(".")
|
||||
assert ".stversions/" in curDir
|
||||
tgDir = curDir.replace(".stversions/", "")
|
||||
|
||||
|
||||
for root, dirs, files in os.walk(curDir):
|
||||
dstRoot = root.replace(curDir, tgDir)
|
||||
os.makedirs(dstRoot, exist_ok=True)
|
||||
for f in files:
|
||||
srcPath = os.path.join(root, f)
|
||||
dstF = f
|
||||
dstPath = os.path.join(dstRoot, dstF)
|
||||
print(f"{srcPath} → {dstPath}")
|
||||
shutil.copy2(srcPath, dstPath)
|
Loading…
Add table
Add a link
Reference in a new issue