rust-libp2p/core/regen_structs_proto.sh
Qian LinFeng fd01b18e53 Upgrade and unify protobuf version(1.x => 2.0.2) (#283)
* Update and unify protobuf version(1.x => 2.0.2)

* Update protobuf codegen shell script
2018-07-10 14:07:28 +02:00

14 lines
435 B
Bash
Executable File

#!/bin/sh
# This script regenerates the `src/structs_proto.rs` and `src/keys_proto.rs` files from
# `structs.proto` and `keys.proto`.
sudo docker run --rm -v `pwd`:/usr/code:z -w /usr/code rust /bin/bash -c " \
apt-get update; \
apt-get install -y protobuf-compiler; \
cargo install --version 2.0.2 protobuf-codegen; \
protoc --rust_out . keys.proto"
sudo chown $USER:$USER keys.rs
mv -f keys.rs ./src/keys_proto.rs