You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/proto/auto_proto.sh

30 lines
638 B

4 years ago
#!/usr/bin/env bash
source ./proto_dir.cfg
for ((i = 0; i < ${#all_proto[*]}; i++)); do
proto=${all_proto[$i]}
3 years ago
protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto
4 years ago
echo "protoc --go_out=plugins=grpc:." $proto
done
2 years ago
echo "proto file generate success"
3 years ago
2 years ago
j=0
2 years ago
for file in $(find ./OpenIM -name "*.go"); do # Not recommended, will break on whitespace
2 years ago
filelist[j]=$file
j=`expr $j + 1`
done
for ((i = 0; i < ${#filelist[*]}; i++)); do
proto=${filelist[$i]}
2 years ago
cp $proto ${proto#*./OpenIM/pkg/proto/}
2 years ago
done
2 years ago
rm OpenIM -rf
#find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdkws\"/\"OpenIM\/pkg\/proto\/sdkws\"/g'
3 years ago
2 years ago