2026-10-11 21:15:13 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
"""Build a WordPress-installable ZIP from this checkout."""
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
import zipfile
|
2026-11-18 15:21:05 +01:00
|
|
|
from sync_shared import verify_shared
|
|
|
|
|
|
2026-10-11 21:15:13 +02:00
|
|
|
root=Path(__file__).resolve().parents[1]
|
2026-11-18 15:21:05 +01:00
|
|
|
verify_shared(root)
|
2026-10-11 21:15:13 +02:00
|
|
|
destination=root/'dist/hg-contactform.zip'
|
|
|
|
|
destination.parent.mkdir(exist_ok=True)
|
|
|
|
|
files=[root/'hg-contactform.php',root/'readme.txt',root/'LICENSE']
|
|
|
|
|
for directory in ['assets','includes']:files.extend(sorted((root/directory).rglob('*')))
|
|
|
|
|
with zipfile.ZipFile(destination,'w',zipfile.ZIP_DEFLATED) as archive:
|
|
|
|
|
for path in files:
|
|
|
|
|
if path.is_file():archive.write(path,Path('hg-contactform')/path.relative_to(root))
|
|
|
|
|
print(destination)
|