Files
foundryvtt-drag-ruler/build_wasm.py
T
Manuel Vögele dc85609a75 Wasm skeleton
2022-01-31 11:03:25 +01:00

14 lines
388 B
Python
Executable File

#!/usr/bin/env python3
import sys
import subprocess
from pathlib import Path
root_dir = Path(".")
wasm_dir = root_dir / Path("wasm")
rust_dir = root_dir / Path("rust")
debug = " --debug" if len(sys.argv) >= 2 and sys.argv[1] == "--debug" else ""
result = subprocess.run(["cargo", "watch", "-C" , rust_dir, "-s", f"wasm-pack build --target web --out-dir {wasm_dir.resolve()}{debug}"])