2026-09-05 00:57:28 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
cd $(dirname "$0")
|
|
|
|
|
BASE_IMPORT_PATH="go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf"
|
|
|
|
|
opts=()
|
|
|
|
|
for file in */*.proto; do
|
|
|
|
|
opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")")
|
|
|
|
|
opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")")
|
2023-04-21 10:49:54 -04:00
|
|
|
done
|
2026-09-05 00:57:28 +03:00
|
|
|
for file in org/signal/chat/*.proto; do
|
|
|
|
|
file_without_ext=$(basename "$file" .proto)
|
|
|
|
|
opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}")
|
|
|
|
|
opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}")
|
|
|
|
|
done
|
|
|
|
|
protoc --go_out=. --go-grpc_out=. \
|
|
|
|
|
--go_opt=module=$BASE_IMPORT_PATH \
|
|
|
|
|
--go-grpc_opt=module=$BASE_IMPORT_PATH "${opts[@]}" \
|
|
|
|
|
*/*.proto org/signal/chat/*.proto
|
2025-01-14 14:13:46 +02:00
|
|
|
pre-commit run -a
|