go-sdk/internal/readme/build.sh
Jonathan Amsterdam ca88999e6b
mcp, internal/readme: fix go generate (#6)
Adjust paths so `go generate` works.
2025-06-23 15:46:53 -04:00

22 lines
682 B
Shell
Executable file

#!/bin/sh
# Build README.md from the files in this directory.
# Must be invoked from the mcp directory.
cd ../internal/readme
outfile=../../README.md
# Compile all the code used in the README.
go build -o /tmp/mcp-readme/ ./...
# Combine the code with the text in README.src.md.
# TODO: when at Go 1.24, use a tool directive for weave.
go run golang.org/x/example/internal/cmd/weave@latest README.src.md > $outfile
if [[ $1 = '-preview' ]]; then
# Preview the README on GitHub.
# $HOME/markdown must be a github repo.
# Visit https://github.com/$HOME/markdown to see the result.
cp $outfile $HOME/markdown/
(cd $HOME/markdown/ && git commit -m . README.md && git push)
fi