Meshtastic-Apple/scripts/gen_protos.sh
2024-07-07 10:57:27 -05:00

18 lines
507 B
Bash
Executable file

#!/bin/bash
# simple sanity checking for repo
if [ ! -d "./protobufs" ]; then
git submodule update --init
else
git submodule update --remote --merge
fi
# simple sanity checking for executable
if [ ! -x "$(which protoc)" ]; then
brew install swift-protobuf
fi
protoc --proto_path=./protobufs --swift_opt=Visibility=Public --swift_out=./MeshtasticProtobufs/Sources ./protobufs/meshtastic/*.proto
echo "Done generating the swift files from the proto files."
echo "Build, test, and commit changes."