Download tasks/build-repair/solution/solve.sh from noodcon/TerminalBench-DockerLess: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/datasets/noodcon/TerminalBench-DockerLess/resolve/main/tasks/build-repair/solution/solve.sh
- Command line
-
hf download hf://datasets/noodcon/TerminalBench-DockerLess/tasks/build-repair/solution/solve.sh
-
curl -L -o solve.sh https://huggingface.co/datasets/noodcon/TerminalBench-DockerLess/resolve/main/tasks/build-repair/solution/solve.sh
877 Bytes
| # Oracle solution: three independent repairs -- the shell variable typo and the | |
| # missing output directory, the dropped final record, and the truncated mean. | |
| set -euo pipefail | |
| cd "$TB_WORK" | |
| cat > build.sh <<'SHEOF' | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| OUT=dist | |
| mkdir -p "$OUT" build | |
| python src/gen.py data/input.txt | tee build/gen.log > "$OUT/report.txt" | |
| python -m pytest tests -q | |
| SHEOF | |
| python - <<'PYEOF' | |
| from pathlib import Path | |
| gen = Path("src/gen.py") | |
| text = gen.read_text(encoding="utf-8") | |
| text = text.replace("for line in lines[:-1]:", "for line in lines:") | |
| gen.write_text(text, encoding="utf-8", newline="\n") | |
| stats = Path("src/lib/stats.py") | |
| text = stats.read_text(encoding="utf-8") | |
| text = text.replace("return total // len(values)", "return total / len(values)") | |
| stats.write_text(text, encoding="utf-8", newline="\n") | |
| PYEOF | |
| bash build.sh | |