matrix-bridge-meshtastic/meshtastic/build-protos.sh
Finn 9f7e00c41e
All checks were successful
/ build-container (push) Successful in 1m51s
Update protobufs
2024-10-30 14:40:36 -07:00

12 lines
646 B
Bash
Executable file

#!/bin/bash
set -exuo pipefail
for src in protobufs-src/meshtastic/*.proto protobufs-src/nanopb.proto; do
dest="protobufs/$(basename "${src}")"
cp -v "${src}" "${dest}"
sed -i 's#option go_package =.*#option go_package = "git.janky.solutions/finn/matrix-meshtastic-bridge-go/meshtastic/protobufs";#' "${dest}"
sed -i 's#import "meshtastic/#import "protobufs/#' "${dest}"
sed -i 's#import "nanopb.proto#import "protobufs/nanopb.proto#' "${dest}"
done
protoc --go_out=. --go_opt=paths=source_relative --go_opt=Mprotobufs/nanopb.proto=git.janky.solutions/finn/matrix-meshtastic-bridge-go/meshtastic/protobufs protobufs/*.proto