From 73bf7d1283b693fffe1368bdbfef9dbe2b399a50 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 11:33:45 -0600 Subject: [PATCH] Fix proto generation script --- gen_protos.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) 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