hopfully fixed it omfg
This commit is contained in:
25
build.py
25
build.py
@@ -96,19 +96,20 @@ def process_root(src_root: Path, out_root: Path, minify: bool, micro: bool):
|
|||||||
print(f" Processing: {src.relative_to(src_root)}")
|
print(f" Processing: {src.relative_to(src_root)}")
|
||||||
|
|
||||||
if has_minify_header(src):
|
if has_minify_header(src):
|
||||||
print(" > Minifying")
|
if minify:
|
||||||
content = minify_file(src)
|
print(" > Minifying")
|
||||||
if micro:
|
content = minify_file(src)
|
||||||
print(" > LZ4 compressing")
|
if micro:
|
||||||
compressed = compress_lz4(content.encode("utf-8"))
|
print(" > LZ4 compressing")
|
||||||
# wrap in kernel.unpack if in hyperion-kernel
|
compressed = compress_lz4(content.encode("utf-8"))
|
||||||
if pkg_dir.name == "hyperion-kernel" and dst.suffix == ".lua":
|
# wrap in kernel.unpack if in hyperion-kernel
|
||||||
content_str = f"kernel.unpack([=[{compressed.hex()}]=])"
|
if pkg_dir.name == "hyperion-kernel" and dst.suffix == ".lua":
|
||||||
dst.write_text(content_str, encoding="utf-8")
|
content_str = f"kernel.unpack([=[{compressed.hex()}]=])"
|
||||||
|
dst.write_text(content_str, encoding="utf-8")
|
||||||
|
else:
|
||||||
|
dst.write_bytes(compressed)
|
||||||
else:
|
else:
|
||||||
dst.write_bytes(compressed)
|
dst.write_text(content, encoding="utf-8")
|
||||||
else:
|
|
||||||
dst.write_text(content, encoding="utf-8")
|
|
||||||
else:
|
else:
|
||||||
print(" > Copying")
|
print(" > Copying")
|
||||||
shutil.copy2(src, dst)
|
shutil.copy2(src, dst)
|
||||||
|
|||||||
Reference in New Issue
Block a user