Files
avo/script/generate
Michael McLoughlin 4550badf58 doc: scripts to run embedmd on markdown files
This will help keep READMEs in sync with code.

Also adds a README for the add example.

Updates #14
2018-12-31 20:25:29 -08:00

25 lines
695 B
Bash
Executable File

#!/bin/bash -ex
# Separate core packages from those that depend on the whole library being built.
core=$(go list ./... | grep -Ev 'avo/(examples|tests)')
post=$(go list ./... | grep -E 'avo/(examples|tests)')
# Install avogen (for bootstrapping).
go install ./internal/cmd/avogen
# Attempt to delete generated files, to prove we can recreate them.
grep -REl 'Code generated.*DO NOT EDIT\.$' . | grep -v '.md$' | xargs rm -v
# Generate once.
go generate -v -x ${core}
# If the instruction database has changed, may need to repeat.
go install ./internal/cmd/avogen
go generate -v -x ${core}
# Generate dependent packages.
go generate -v -x ${post}
# Regenerate documentation.
./script/doc