bitar 0.13.0

bita archive utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
    let output_file = std::path::PathBuf::from("src/chunk_dictionary.rs");
    let generated_file =
        std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("chunk_dictionary.rs");

    if !output_file.exists() {
        prost_build::Config::new()
            .btree_map(["."])
            .compile_protos(&["proto/chunk_dictionary.proto"], &["proto/"])
            .unwrap();

        let content = format!(
            "// THIS FILE IS AUTOMATICALLY GENERATED\n// EDIT ../proto/chunk_dictionary.proto INSTEAD\n\n{}",
            std::fs::read_to_string(generated_file).unwrap()
        );
        std::fs::write(output_file, content).unwrap();
    }
}