优化编译脚本

This commit is contained in:
刘祥超
2023-12-23 10:04:37 +08:00
parent 7f0822000c
commit deea02b1ab

View File

@@ -2,27 +2,27 @@
echo "starting ..." echo "starting ..."
function assert() {
RESULT=$?
if [ "${RESULT}" != "0" ]; then
exit
fi
}
#rm -f ../pkg/rpc/pb/*.pb.go #rm -f ../pkg/rpc/pb/*.pb.go
protoc --go_out=../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto protoc --go_out=../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto
RESULT=$? assert
if [ "${RESULT}" != "0" ]; then
exit
fi
protoc --go-grpc_out=../pkg/rpc --go-grpc_opt=require_unimplemented_servers=false --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto protoc --go-grpc_out=../pkg/rpc --go-grpc_opt=require_unimplemented_servers=false --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto
RESULT=$? assert
if [ "${RESULT}" != "0" ]; then
exit
fi
protoc --go_out=../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto protoc --go_out=../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto
RESULT=$? RESULT=$?
if [ "${RESULT}" != "0" ]; then assert
exit
fi
# generate rpc.json # generate rpc.json
./proto-json.sh --quiet ./proto-json.sh --quiet
assert
echo "ok" echo "ok"