Skip to content

Commit 2d98844

Browse files
committed
Add scripts
1 parent 36774d0 commit 2d98844

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

scripts/protogen.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
6+
for dir in $proto_dirs; do
7+
protoc \
8+
-I "proto" \
9+
-I "third_party/proto" \
10+
--gocosmos_out=plugins=interfacetype+grpc,\
11+
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
12+
$(find "${dir}" -maxdepth 1 -name '*.proto')
13+
14+
# command to generate gRPC gateway (*.pb.gw.go in respective modules) files
15+
protoc \
16+
-I "proto" \
17+
-I "third_party/proto" \
18+
--grpc-gateway_out=logtostderr=true:. \
19+
$(find "${dir}" -maxdepth 1 -name '*.proto')
20+
21+
done
22+
23+
# move proto files to the right places
24+
cp -r github.com/OmniFlix/onft/types/* ./types
25+
rm -rf github.com
26+

0 commit comments

Comments
 (0)