nomadweb/redmini/scripts/assemble.py
eric 73b0513b9c Add WeChat, Douyin, and offline XHS mini-program scaffolds.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-27 12:57:18 -05:00

26 lines
677 B
Python

#!/usr/bin/env python3
"""Copy tool/ into release/ and embed src/data.js (no network)."""
from __future__ import annotations
import shutil
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
TOOL = ROOT / "tool"
SRC_DATA = ROOT / "src" / "data.js"
RELEASE = ROOT / "release"
def main() -> int:
if RELEASE.exists():
shutil.rmtree(RELEASE)
RELEASE.mkdir(parents=True)
for name in ("index.html", "styles.css", "app.js", "xhs-bridge.js"):
shutil.copy2(TOOL / name, RELEASE / name)
shutil.copy2(SRC_DATA, RELEASE / "data.js")
print(f"assembled {RELEASE}")
return 0
if __name__ == "__main__":
raise SystemExit(main())