26 lines
677 B
Python
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())
|