forked from lum-network/chain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocgen.sh
More file actions
26 lines (20 loc) · 686 Bytes
/
protocgen.sh
File metadata and controls
26 lines (20 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -eo pipefail
# get protoc executions
go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null
# get cosmos sdk from github
go get github.com/cosmos/cosmos-sdk 2>/dev/null
echo "Generating gogo proto code"
cd proto
proto_dirs=$(find ./lum-network -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
if grep go_package $file &>/dev/null; then
buf generate --template buf.gen.gogo.yaml $file
fi
done
done
cd ..
# move proto files to the right places
cp -r github.com/lum-network/chain/* ./
rm -rf github.com