Download frontend/web/build.sh from Snapkitty/cpsc-qft: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/Snapkitty/cpsc-qft/resolve/main/frontend/web/build.sh
- Command line
-
hf download hf://Snapkitty/cpsc-qft/frontend/web/build.sh
-
curl -L -o build.sh https://huggingface.co/Snapkitty/cpsc-qft/resolve/main/frontend/web/build.sh
1.2 kB
| # Build the Mercury web console: | |
| # mercury_bundle.rb — concatenated Ruby library + WASM bridge (fetched by qsim.html at boot) | |
| # qsim.html — the console; references CDN wasm assets (works in any modern browser) | |
| # Drop both files side-by-side anywhere static (e.g. docs/ for GitHub Pages). | |
| set -euo pipefail | |
| cd "$(dirname "$0")" | |
| { | |
| for f in ../lib/mercury/version.rb \ | |
| ../lib/mercury/gates.rb \ | |
| ../lib/mercury/circuit.rb \ | |
| ../lib/mercury/simulator.rb \ | |
| ../lib/mercury/mini_json.rb \ | |
| ../lib/mercury/cpsc.rb \ | |
| app.rb; do | |
| echo "# ---- $f ----" | |
| cat "$f" | |
| echo "" | |
| done | |
| } > mercury_bundle.rb | |
| ruby -c mercury_bundle.rb | |
| echo "wrote mercury_bundle.rb ($(wc -c < mercury_bundle.rb) bytes), qsim.html is index.html" | |
| cp index.html qsim.html | |
| echo "wrote qsim.html ($(wc -c < qsim.html) bytes)" | |
| mkdir -p ../../docs | |
| cp qsim.html ../../docs/qsim.html | |
| cp mercury_bundle.rb ../../docs/mercury_bundle.rb | |
| python3 -c 'from pathlib import Path; q=Path("../../docs/qsim.html"); q.write_text(q.read_text().replace("href=\"./index.html\"", "href=\"./\""))' | |
| echo "published docs/qsim.html and docs/mercury_bundle.rb" | |