#!/bin/sh
# script/generate: regenerate mfer/mf.pb.go from mfer/mf.proto, and record
# the hash of that mf.proto in mfer/mf.proto.sha256. Nothing else
# regenerates mf.pb.go: it is committed, so building and checking need no
# protoc. Needs protoc and protoc-gen-go on PATH. A test fails while
# mf.proto no longer matches the recorded hash.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

main() {
    cd "$ROOT/mfer"
    go generate .
    shasum -a 256 mf.proto >mf.proto.sha256
}

main "$@"
