diff --git a/gen_protos.sh b/gen_protos.sh index 4cf7e405..da96dd76 100755 --- a/gen_protos.sh +++ b/gen_protos.sh @@ -12,8 +12,17 @@ if [ ! -x "`which protoc`" ]; then exit fi +if [ ! -x "`which gsed`" ]; then + echo "Please install gnu-sed by running: brew install gnu-sed" + exit +fi + pdir=$(realpath "../protobufs/meshtastic") sdir=$(realpath "./Meshtastic/Protobufs") + +gsed -i 's/import "meshtastic\//import "/g' ../protobufs/meshtastic/* +gsed -i 's/package meshtastic;//g' ../protobufs/meshtastic/* + echo "pdir:$pdir sdir:$sdir" pfiles="admin.proto apponly.proto cannedmessages.proto channel.proto config.proto device_metadata.proto deviceonly.proto localonly.proto mesh.proto module_config.proto mqtt.proto portnums.proto remote_hardware.proto rtttl.proto storeforward.proto telemetry.proto xmodem.proto" for pf in $pfiles @@ -24,3 +33,5 @@ do done echo "Done generating the swift files from the proto files." echo "Build, test, and commit changes." + +cd ../protobufs/meshtastic && git reset --hard \ No newline at end of file