perf: improving performance, layout (#215)

Co-authored-by: nullishamy <git@amyerskine.me>
This commit is contained in:
iruzo
2024-06-01 21:49:55 +03:00
committed by GitHub
parent 54633c0f72
commit cadc3e2ac2
37 changed files with 1015 additions and 665 deletions

35
sources/build/patches.py Normal file
View File

@@ -0,0 +1,35 @@
import os
import subprocess
from pathlib import Path
from .logger import logger
def apply_colloid_patches(colloid_dir, patch_dir):
colloid_dir = Path(colloid_dir).relative_to(os.getcwd())
if os.path.isfile(colloid_dir / ".patched"):
logger.info(
f'Patches seem to be applied, remove "{colloid_dir}/.patched" to force application (this may fail)'
)
return
logger.info("Applying patches...")
# Change into colloid
for patch in [
"plank-dark.patch",
"plank-light.patch",
"sass-palette-frappe.patch",
"sass-palette-mocha.patch",
"sass-palette-latte.patch",
"sass-palette-macchiato.patch",
"theme-func.patch",
]:
path = (Path(patch_dir) / patch).relative_to(os.getcwd())
logger.info(f"Applying patch '{patch}', located at '{path}'")
subprocess.check_call(
["git", "apply", str(path), "--directory", str(colloid_dir)]
)
with open(colloid_dir / ".patched", "w") as f:
f.write("true")
logger.info("Patching finished.")