-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·27 lines (25 loc) · 1.1 KB
/
run.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
shopt -s nullglob
echo "++++++++++++++++++++++++++++++++++++++++++++"
echo " Proto generation from Sysl "
echo "++++++++++++++++++++++++++++++++++++++++++++"
for file in demo/*.sysl; do
echo "Reading Sysl file \"$file\""
echo "Generating json for \"$file\""
read -p "Enter the target sysl appname, comma separate if more than one : " app
IFS=',' read -ra apps <<< "$app"
for i in "${apps[@]}"
do
read -p "Enter the target sysl package for "$i": " package
rm -rf "demo/$i.json"
rm -rf "gen/proto/$package"
mkdir "gen/proto/$package"
sysl pb --mode json $file >> "demo/$i.json"
echo "Now generating proto files for $i"
echo "Running arrai.ai to generate proto file"
arrai r transform/grpcgen.arrai $i "demo/$i.json" >> "gen/proto/$package/$i.proto"
protoc -I=gen/proto/$package --go_out=gen/proto/$package "gen/proto/$package/$i.proto"
done
done
echo "++++++++++++++++++++++++++++++++++++++++++++"
echo " End "
echo "++++++++++++++++++++++++++++++++++++++++++++"