blob: 97f55c0454f2dce32cd2b0c5e3b4fd1497d580cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env python3
import os
import shutil
def build():
shutil.rmtree("build", ignore_errors=True)
os.makedirs("build/gmi")
for directory, _, files in os.walk("content"):
for file in files:
if file.endswith("gmi"):
new_dir = f"build/gmi/{directory[8:]}"
os.makedirs(new_dir, exist_ok=True)
shutil.copyfile(f"{directory}/{file}", f"{new_dir}/{file}")
else:
# FIXME
pass
if __name__ == "__main__":
build()
|