14 lines
321 B
Rust
14 lines
321 B
Rust
|
use std::error::Error;
|
||
|
use std::process::Command;
|
||
|
|
||
|
fn main() -> Result<(), Box<dyn Error>> {
|
||
|
let hash = Command::new("git")
|
||
|
.arg("rev-parse")
|
||
|
.arg("--short")
|
||
|
.arg("HEAD")
|
||
|
.output()?
|
||
|
.stdout;
|
||
|
println!("cargo:rustc-env=VERSION={}", std::str::from_utf8(&hash)?);
|
||
|
Ok(())
|
||
|
}
|