You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/rust/trezor-client/scripts/generate-protos.sh

17 lines
494 B

#!/bin/sh
# Generates src/protos/
# Requires the `protoc-gen-rust` binary (`cargo install protoc-gen-rust`).
# Overwrites src/protos/mod.rs, but the change should not be committed, and
# instead should be handled manually.
crate_root="$(dirname "$(dirname "$(realpath "$0")")")"
main_root="$(dirname $(dirname "$crate_root"))"
out_dir="$crate_root/src/protos"
proto_dir="$main_root/common/protob"
protoc \
--proto_path "$proto_dir" \
--rust_out "$out_dir" \
"$proto_dir"/*.proto