Files
dpl/scripts/theme-fuc/package.py
T
hellcat 0501711267 feat(fuc-xb): prepare isolated staging theme and VIP auto upgrades
Port the Fuc 0.12.0 frontend and default-off VIP plugin. Include the previously approved password-reset token revocation. Deploy only to an independent FUC-XB test instance; no production cutover.
2026-11-04 13:44:33 +08:00

21 lines
1.0 KiB
Python

#!/usr/bin/env python3
"""Package only Fuc runtime files; never includes preview data, tests or site settings."""
import hashlib
import json
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
ROOT = Path(__file__).resolve().parents[2]
SOURCE = ROOT / 'theme/Fuc'
FILES = ['config.json','dashboard.blade.php']
FILES += [str(p.relative_to(SOURCE)) for p in sorted((SOURCE/'assets').glob('*.mjs')) if p.is_file()]
FILES += [str(p.relative_to(SOURCE)) for p in sorted((SOURCE/'assets/vendor').rglob('*')) if p.is_file()]
FILES += [str(p.relative_to(SOURCE)) for p in sorted((SOURCE/'assets/native').rglob('*')) if p.is_file() and p.name != 'manifest.json']
config = json.loads((SOURCE / 'config.json').read_text())
output = ROOT / 'codex/output/fuc-theme' / f'Fuc-{config["version"]}.zip'
output.parent.mkdir(parents=True, exist_ok=True)
with ZipFile(output,'w',ZIP_DEFLATED) as bundle:
for name in FILES:
bundle.write(SOURCE / name, f'Fuc/{name}')
print(output)
print(f'SHA256 {hashlib.sha256(output.read_bytes()).hexdigest()}')