2024-10-19 01:21:50 +00:00
|
|
|
#!/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
|
|
|
|
|
2024-10-30 21:40:36 +00:00
|
|
|
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
|