pkgdash/proto/generate.sh

14 lines
663 B
Bash
Raw Normal View History

2023-08-07 21:30:30 +03:00
#!/bin/sh -ex
PROTO_ARGS=" \
2023-08-07 21:30:30 +03:00
--proto_path=$(go list -f '{{ .Dir }}' -m github.com/envoyproxy/protoc-gen-validate) \
--proto_path=$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) \
--go_out=paths=source_relative:go_generate \
--go-micro_out=module=go.unistack.org/unistack-org/pkgdash/proto/go_generate,components=micro|http,standalone=true:./micro \
--validate_out=paths=source_relative,lang=go:go_generate
"
2023-08-07 21:30:30 +03:00
find . -not \( -name "*.sh" -or -name "*.proto" -or -name "generate.go" \) -delete
mkdir -p micro go_generate && \
protoc -I. $PROTO_ARGS ./*.proto || \
find . -not \( -name "*.sh" -or -name "*.proto" -or -name "generate.go" \) -delete