| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 | #!/usr/bin/python from pathlib import Pathfrom json import loadsfrom shutil import rmtreefrom shutil import copytreefrom cx_maketool import sass_compilerfrom cx_maketool import esbuild_compilerfrom cx_maketool import renderfrom cx_maketool import scriptfrom cx_maketool import linkroot = Path(__file__).absolute().parentsource = root / Path("source/")build = root / Path("./")styles = source / Path("stylesheet/")scripts = source / Path("scripts/")assets = source / Path("assets/")assets_output = build / Path("assets/")scripts_loader = scripts / Path("core.js")theme_loader = styles / Path("core.sass")info_file = source / Path("about.txt")script_bundle = build / Path("script.js")theme_bundle = build / Path("style.css")if theme_bundle.is_file():    theme_bundle.unlink()if script_bundle.is_file():    script_bundle.unlink()sass_compiler(theme_loader).build(theme_bundle)esbuild_compiler(scripts_loader).build(script_bundle)if assets_output.exists():    rmtree(assets_output)copytree(assets, assets_output)with info_file.open() as info:    info_content = info.read()with theme_bundle.open() as theme:    content = theme.read()with theme_bundle.open("w") as theme:    theme.write(info_content + content)
 |