Download scripts/quick_check.py from khiemdztv/civic-backup: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/khiemdztv/civic-backup/resolve/main/scripts/quick_check.py
- Command line
-
hf download hf://khiemdztv/civic-backup/scripts/quick_check.py
-
curl -L -o quick_check.py https://huggingface.co/khiemdztv/civic-backup/resolve/main/scripts/quick_check.py
507 Bytes
| import re | |
| import subprocess | |
| from pathlib import Path | |
| html = Path("static_space/index.html").read_text(encoding="utf-8") | |
| scripts = re.findall(r"<script>(.*?)</script>", html, re.DOTALL) | |
| for i, s in enumerate(scripts): | |
| Path(f"/tmp/check_{i}.js").write_text(s, encoding="utf-8") | |
| res = subprocess.run(["node", "--check", f"/tmp/check_{i}.js"], capture_output=True, text=True) | |
| if res.returncode == 0: | |
| print("Syntax check passed!") | |
| else: | |
| print("Syntax check failed:", res.stderr) | |