interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / tools / doi / build.sh
| 1 | #!/bin/sh |
| 2 | # Compile only; no request, token or deposit. Usage: build.sh [OMC [OUTDIR]]. |
| 3 | set -eu |
| 4 | export LC_ALL=C |
| 5 | D=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
| 6 | OMC=${1:-$HOME/work/flux/omega-mv/seed/out/omc} |
| 7 | OUT=${2:-$D/../../.build/doi} |
| 8 | PIN=3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194 |
| 9 | actual=$(sha256sum "$OMC"); actual=${actual%% *} |
| 10 | [ "$actual" = "$PIN" ] || { echo 'doi build: omc is not the pin' >&2; exit 2; } |
| 11 | mkdir -p -- "$OUT" |
| 12 | trap 'rm -f -- "$OUT/doi.new"' EXIT |
| 13 | "$OMC" < "$D/doi.om" > "$OUT/doi.new" |
| 14 | chmod 755 "$OUT/doi.new" |
| 15 | mv -- "$OUT/doi.new" "$OUT/doi" |