-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_client.sh
executable file
·33 lines (26 loc) · 958 Bytes
/
update_client.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
#!/bin/bash
set -e
# Get protoset file from your starlink
echo -e "\033[0;32m→ Retrieving protoset file from your Starlink \033[0m"
grpcurl -plaintext -protoset-out "assets/starlink.protoset" "192.168.100.1:9200" describe SpaceX.API.Device.Device
# Convert protoset to proto
echo -e "\033[0;32m→ Converting protoset to proto \033[0m"
rm -rf proto
./vendor/bin/protoset-converter "assets/starlink.protoset" "./proto/"
# Remove google and grpc .proto files
echo -e "\033[0;32m→ Removing google and grpc .proto files \033[0m"
rm -rf proto/google
rm -rf proto/grpc
echo -e "\033[0;32m→ Generating PHP client \033[0m"
rm -rf generated/
mkdir -p generated/
# Find all .proto files recursively
PROTO_FILES=$(find proto -name "*.proto")
protoc \
--php_out=generated/ \
--grpc_out=generated/ \
--plugin=protoc-gen-grpc="$(which grpc_php_plugin)" \
-I./proto \
$PROTO_FILES
echo -e "\033[0;32m→ Linting .php files \033[0m"
./vendor/bin/pint