forked from neutron-org/neutron-integration-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen-proto.sh
executable file
·42 lines (35 loc) · 876 Bytes
/
gen-proto.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
#!/usr/bin/env bash
rm -r ./proto
cp -r ../neutron/proto ./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
npx pbjs \
-o ./src/generated/proto.cjs \
-t static-module \
--force-long \
--keep-case \
--no-create \
--path=./proto/ \
--path=./proto-thirdparty/ \
--root="@neutron-org/neutron" \
${proto_files[@]}
npx pbjs \
-o ./src/generated/proto.js \
-t static-module \
-w es6 \
--es6 \
--force-long \
--keep-case \
--no-create \
--path=./proto/ \
--path=./proto-thirdparty/ \
--root="@neutron-org/neutron" \
${proto_files[@]}
npx pbts \
-o ./src/generated/proto.d.ts \
./src/generated/proto.js
rm ./src/generated/proto.js
rm -r ./proto