2020-03-30 23:58:32 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
find . -type f -name '*.pb.*.go' -o -name '*.pb.go' -a ! -name 'message.pb.go' -delete
|
2020-04-15 13:22:32 +03:00
|
|
|
PROTOS=$(find . -type f -name '*.proto' | grep -v proto/google/api)
|
|
|
|
|
|
|
|
mkdir -p proto/google/api
|
|
|
|
curl -s -o proto/google/api/annotations.proto -L https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto
|
|
|
|
curl -s -o proto/google/api/http.proto -L https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto
|
2020-03-30 23:58:32 +03:00
|
|
|
|
|
|
|
for PROTO in $PROTOS; do
|
|
|
|
echo $PROTO
|
2020-08-19 17:47:17 +03:00
|
|
|
protoc -I./proto -I. -I$(dirname $PROTO) --go-grpc_out=paths=source_relative:. --go_out=paths=source_relative:. --micro_out=paths=source_relative:. $PROTO
|
2020-03-30 23:58:32 +03:00
|
|
|
done
|
2020-04-15 13:22:32 +03:00
|
|
|
|
|
|
|
rm -r proto
|