mirror of
https://github.com/mautrix/signal.git
synced 2026-11-10 08:09:18 -05:00
18 lines
701 B
Shell
Executable file
18 lines
701 B
Shell
Executable file
#!/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")")
|
|
done
|
|
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
|
|
pre-commit run -a
|