5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-03 01:18:02 +03:00
proxmox-backup/pbs-buildcfg/build.rs
Fabian Grünbichler 16f6766a68 clippy 1.65 fixes
and rustfmt

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-05 11:40:02 +01:00

18 lines
461 B
Rust

// build.rs
use std::env;
use std::process::Command;
fn main() {
let repoid = match env::var("REPOID") {
Ok(repoid) => repoid,
Err(_) => match Command::new("git").args(["rev-parse", "HEAD"]).output() {
Ok(output) => String::from_utf8(output.stdout).unwrap(),
Err(err) => {
panic!("git rev-parse failed: {}", err);
}
},
};
println!("cargo:rustc-env=REPOID={}", repoid);
}