auto-app-builder / helpers.py
offerpk3's picture
Update helpers.py
b3c7d74 verified
raw
history blame contribute delete
310 Bytes
import zipfile
import io
def save_as_zip(bundle: dict) -> bytes:
zip_buffer = io.BytesIO()
with zipfile.ZipFile(zip_buffer, "w") as zipf:
for filename, content in bundle.get("files", {}).items():
zipf.writestr(filename, content)
zip_buffer.seek(0)
return zip_buffer.read()