system's picture
system HF Staff
Publish reviewed ShellBench release
ac721cd verified
Raw History Blame Contribute Delete
532 Bytes
#!/usr/bin/env bash
set -euo pipefail
export PYTHONPATH="${WORKSPACE_DIR:-/app}${PYTHONPATH:+:$PYTHONPATH}"
cd "${WORKSPACE_DIR:-/app}"
python3 - <<'PY'
from pathlib import Path
path = Path("app.js")
source = path.read_text(encoding="utf-8")
wrong = 'document.getElementById("contact-formm")'
right = 'document.getElementById("contact-form")'
if wrong not in source:
raise SystemExit("app.js no longer contains the expected selector typo")
path.write_text(source.replace(wrong, right), encoding="utf-8")
PY
node --check app.js