chore: move to crates folder
This commit is contained in:
1 parent
5d10c0d8a8
commit
cb3660bcd2
3393 files changed
+1270
-741
No files matched your search
@@ -0,0 +1,30 @@
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
// Get short hash (7 chars) for display
|
||||
let short_output = Command::new("git")
|
||||
.args(["rev-parse", "--short=7", "HEAD"])
|
||||
.output();
|
||||
|
||||
let git_hash_short = match short_output {
|
||||
Ok(output) if output.status.success() => {
|
||||
String::from_utf8_lossy(&output.stdout).trim().to_string()
|
||||
}
|
||||
_ => "unknown".to_string(),
|
||||
};
|
||||
|
||||
// Get full hash for hover text
|
||||
let full_output = Command::new("git").args(["rev-parse", "HEAD"]).output();
|
||||
|
||||
let git_hash_full = match full_output {
|
||||
Ok(output) if output.status.success() => {
|
||||
String::from_utf8_lossy(&output.stdout).trim().to_string()
|
||||
}
|
||||
_ => "unknown".to_string(),
|
||||
};
|
||||
|
||||
println!("cargo::rerun-if-changed=../.git/HEAD");
|
||||
println!("cargo::rerun-if-changed=../.git/refs/heads/");
|
||||
println!("cargo::rustc-env=GIT_HASH={git_hash_short}");
|
||||
println!("cargo::rustc-env=GIT_HASH_FULL={git_hash_full}");
|
||||
}
|
||||
Reference in new issue
Block a user