mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
Small changes
This commit is contained in:
parent
7196c719e2
commit
0526cc9412
8 changed files with 84 additions and 69 deletions
17
build.rs
Normal file
17
build.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
let output = match Command::new("git").args(&["rev-parse", "HEAD"]).output() {
|
||||
Ok(d) => d,
|
||||
Err(err) => {
|
||||
eprintln!("Can't run git and get last commit due: {err:?}");
|
||||
println!("cargo:rustc-env=GIT_HASH=0000000000000000000000000000000000000000");
|
||||
return
|
||||
}
|
||||
};
|
||||
let mut git_hash = String::from_utf8(output.stdout).unwrap();
|
||||
if &git_hash == "HEAD" || git_hash.len() < 7 {
|
||||
git_hash = String::from("0000000000000000000000000000000000000000");
|
||||
}
|
||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue