Download code/notes/src/build_all.sh from viai957/align: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/viai957/align/resolve/main/code/notes/src/build_all.sh
- Command line
-
hf download hf://viai957/align/code/notes/src/build_all.sh
-
curl -L -o build_all.sh https://huggingface.co/viai957/align/resolve/main/code/notes/src/build_all.sh
1.02 kB
| # usage: build_all.sh -> rebuild all 24 note PDFs (names "NNNN - Title.pdf" in ../) | |
| # build_all.sh 0107 0203 -> rebuild only those | |
| set -o pipefail | |
| source /apps/paper-tools/env.sh >/dev/null 2>&1 | |
| cd "$(dirname "$0")" | |
| mkdir -p build/all | |
| sel=("$@"); fail=0; n=0 | |
| for tex in 0[123][0-9][0-9]-*.tex; do | |
| id=${tex%%-*} | |
| if [ ${#sel[@]} -gt 0 ] && [[ ! " ${sel[*]} " == *" $id "* ]]; then continue; fi | |
| slug=${tex%.tex} | |
| existing=$(ls ../"$id"\ -\ *.pdf 2>/dev/null | head -1) | |
| if [ -z "$existing" ]; then echo "SKIP $id: no existing ../$id - Title.pdf to take the name from"; continue; fi | |
| if TEXINPUTS=".:${TEXINPUTS:-}" latexmk -pdf -interaction=nonstopmode -halt-on-error -outdir=build/all "$tex" >build/all/$slug.console.log 2>&1; then | |
| cp "build/all/$slug.pdf" "$existing"; n=$((n+1)); echo "built $existing" | |
| else echo "FAIL $id (see build/all/$slug.console.log)"; tail -15 build/all/$slug.console.log; fail=$((fail+1)); fi | |
| done | |
| echo "built=$n failed=$fail"; [ $fail -eq 0 ] | |