Skip to content

Commit

Permalink
feat: update script to handle rpc and grpc seperatly
Browse files Browse the repository at this point in the history
  • Loading branch information
keivanipchihagh committed Mar 18, 2024
1 parent 50dce8e commit 4d8e4fe
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@ else
fi

# Build *.proto files within the ./protos/ directory
python3 -m grpc_tools.protoc\
--proto_path=$proto_dirs\
--python_out=$python_dir\
--grpc_python_out=$python_dir\
$proto_dirs/*.proto # ./protos/*.proto
for file in $proto_dirs/*.proto; do
filename=$(basename "$file")
if echo "$filename" | grep -q "struct"; then
# Only RPC for structs
python3 -m grpc_tools.protoc\
--proto_path=$proto_dirs\
--python_out=$python_dir\
$file
else
# RPC and gRPC for non structs
python3 -m grpc_tools.protoc\
--proto_path=$proto_dirs\
--python_out=$python_dir\
--grpc_python_out=$python_dir\
$file
fi
done

0 comments on commit 4d8e4fe

Please sign in to comment.