From 8271997279c7a12d37690056199a0f63aae40ffd Mon Sep 17 00:00:00 2001 From: foglet15 Date: Sun, 25 Feb 2024 13:28:28 -0500 Subject: [PATCH] fix sed commands and dir path --- bin/regen-protobufs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/regen-protobufs.sh b/bin/regen-protobufs.sh index dc1c2fa..068686d 100755 --- a/bin/regen-protobufs.sh +++ b/bin/regen-protobufs.sh @@ -4,16 +4,16 @@ #gsed -i 's/import "\//import ".\//g' ./protobufs/meshtastic/* #gsed -i 's/package meshtastic;//g' ./protobufs/meshtastic/* -./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./meshtastic/pbDefinitions ./protobufs/meshtastic/*.proto +./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./pbDefinitions ./protobufs/meshtastic/*.proto # workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628 if [[ $OSTYPE == 'darwin'* ]]; then - sed -i '' -E 's/^(import.*_pb2)/from . \1/' meshtastic/*.py + sed -i '' -E 's/^(import.*_pb2)/from . \1/' meshtastic/pbDefinitions/*.py # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27) - sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py + sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/pbDefinitions/mesh_pb2.py else - sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/*.py + sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/pbDefinitions/*.py # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27) - sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py + sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/pbDefinitions/mesh_pb2.py fi