|
| 1 | +#! /bin/bash |
| 2 | +# Copyright 2025 gRPC authors. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | + |
| 17 | +set -e |
| 18 | + |
| 19 | +GRPC_ROOT=$(realpath "$(dirname "$0")/../..") |
| 20 | + |
| 21 | +# Source and destination directories (base paths). |
| 22 | +SRC_BASE="$GRPC_ROOT/src/proto/grpc" |
| 23 | +DST_BASE="$GRPC_ROOT/src/python" |
| 24 | + |
| 25 | +copy_proto() { |
| 26 | + local proto_name="$1" |
| 27 | + local src_subdir="$2" |
| 28 | + local dst_subdir="$3" |
| 29 | + |
| 30 | + local src_file="$SRC_BASE/$src_subdir/$proto_name.proto" |
| 31 | + local dst_file="$DST_BASE/$dst_subdir/$proto_name.proto" |
| 32 | + |
| 33 | + cp "$src_file" "$dst_file" |
| 34 | + echo "Copied: $src_file -> $dst_file" |
| 35 | +} |
| 36 | + |
| 37 | +# copy_proto proto_name src_subdir dst_subdir |
| 38 | +copy_proto "channelz" "channelz" "grpcio_channelz/grpc_channelz/v1" |
| 39 | +copy_proto "health" "health/v1" "grpcio_health_checking/grpc_health/v1" |
| 40 | +copy_proto "reflection" "reflection/v1alpha" "grpcio_reflection/grpc_reflection/v1alpha" |
| 41 | + |
| 42 | +echo "Proto files copied successfully." |
0 commit comments