-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen-proto-ibc-go.sh
executable file
·59 lines (48 loc) · 1.32 KB
/
gen-proto-ibc-go.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
rm -r ./proto
rm -r ./proto-thirdparty-tmp
rm -rf ./ibc-go
git clone git@github.com:cosmos/ibc-go.git
cd ibc-go && git checkout v4.3.0 && cd ../
git clone git@github.com:Ethernal-Tech/admin-module.git
cp -r ibc-go/proto ./proto
cp -r ibc-go/third_party/proto ./proto-thirdparty-tmp
mv ./proto-thirdparty-tmp/tendermint ./proto/
cp -r ./admin-module/proto/adminmodule ./proto/
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
proto_files=()
for dir in $proto_dirs; do
proto_files=("${proto_files[@]} $(find "${dir}" -maxdepth 1 -name '*.proto')")
done
echo ${proto_files[@]}
npx pbjs \
-o ./src/generated/ibc/proto.cjs \
-t static-module \
--force-long \
--keep-case \
--no-create \
--path=./proto/ \
--path=./proto-thirdparty-tmp/ \
--path=./proto-thirdparty/ \
--root="@cosmos-client/ibc" \
${proto_files[@]}
npx pbjs \
-o ./src/generated/ibc/proto.js \
-t static-module \
-w es6 \
--es6 \
--force-long \
--keep-case \
--no-create \
--path=./proto/ \
--path=./proto-thirdparty-tmp/ \
--path=./proto-thirdparty/ \
--root="@cosmos-client/ibc" \
${proto_files[@]}
npx pbts \
-o ./src/generated/ibc/proto.d.ts \
./src/generated/ibc/proto.js
rm -r ./proto
rm -r ./proto-thirdparty-tmp
rm -rf ./ibc-go
rm -rf ./admin-module