aboutsummaryrefslogtreecommitdiffstats
path: root/crates/client/build.rs
blob: 17a532cca79e92c5f03e0dc37b3624c96eb38868 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::process::Command;
use std::{env, fs, path::PathBuf};

use protox::Compiler;
use protox::prost::Message;

fn main() -> Result<(), std::io::Error> {
    {
        let output = Command::new("git").args(["rev-parse", "HEAD"]).output();

        let sha = match output {
            Ok(sha) => String::from_utf8(sha.stdout).unwrap(),
            Err(_) => String::from("NO_GIT"),
        };

        println!("cargo:rustc-env=GIT_HASH={sha}");
    }

    Ok(())
}