#[cfg(feature = "proto-gen")]
use protobuf_codegen;
#[cfg(feature = "proto-gen")]
use std::fs;
#[cfg(feature = "proto-gen")]
fn proto_gen() {
protobuf_codegen::Codegen::new()
.pure()
.out_dir("proto/")
.includes(&["proto/"])
.input("proto/metadata.proto")
.run_from_script();
let proto_mod_rs =
fs::read_to_string("proto/mod.rs").expect("Unable to open file");
let header = "// Header added by Tindercrypt's build.rs script\n\
#![allow(missing_docs)]\n\n";
let new_proto_mod_rs = header.to_owned() + &proto_mod_rs;
fs::write("proto/mod.rs", new_proto_mod_rs).expect("Unable to write file");
}
fn main() {
#[cfg(feature = "proto-gen")]
proto_gen()
}