forked from city404/v6-public-rpc-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·77 lines (65 loc) · 1.72 KB
/
make.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# go get -u github.com/golang/protobuf/protoc-gen-go
# go get -u google.golang.org/protobuf/cmd/protoc-gen-go
# go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
git pull
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
GOPATH=$(go env GOPATH)
export PATH=$PATH:$GOPATH/bin
DIRS=("common" "slice" "user" "userfile" "offline" "rpcs" "wrtc" "share" "webdav" "sftp")
rm -rf ./go_temp
mkdir ./go_temp
OUT_DIR=`pwd`
function makeFile(){
file=$1
echo "Generate: ${file}"
protoc --go_out=./go_temp --go-grpc_out=./go_temp ${file}
}
# for name in ${DIRS}
for(( i=0;i<${#DIRS[@]};i++))
do
name=${DIRS[i]}
echo "Generate from: ${name}"
for file in ./${name}/*.proto
do
makeFile $file
done
done
echo "Clean Go Files"
rm -rf ./go
cp -r ./go_temp/github.com/city404/v6-public-rpc-proto/go ./
rm -rf ./go_temp
cd ./go
# cp ../main.go ./
go mod init github.com/city404/v6-public-rpc-proto/go
# go get google.golang.org/grpc
go get
# go get github.com/golang/protobuf@master
go get golang.org/x/net
go mod tidy
cd ..
# echo "Copy JavaScript Files"
# rm -rf ${nodejs_path}
# mkdir ${nodejs_path}
# cp -r ./user ${nodejs_path}
# cp -r ./store ${nodejs_path}
# cp -r ./file ${nodejs_path}
# cp -r ./common ${nodejs_path}
# cp -r ./remotetask ${nodejs_path}
# cp -r ./offline ${nodejs_path}
# cp -r ./share ${nodejs_path}
# cp -r ./ext ${nodejs_path}
# cp -r ./report ${nodejs_path}
#rm -rf ./temp
#mkdir ./temp
#cd ./temp
#git clone https://github.com/zzzhr1990/ts-api-define.git
#cd ./ts-api-define
#cp -R ../../ts-api-define/* ./
#rm -rf ./node_modules
git add .
git commit -m "Auto commit"
git push
# cd ../..
echo "Done at:"`pwd`