2026-04-19 08:14:25 -03:00
|
|
|
fn main() {
|
2026-04-28 14:20:46 -03:00
|
|
|
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
|
let ui_path = std::path::Path::new(&manifest_dir).join("ui");
|
|
|
|
|
println!("cargo:rustc-env=BOTUI_UI_PATH={}", ui_path.display());
|
|
|
|
|
|
|
|
|
|
let commit = std::env::var("BOTUI_COMMIT")
|
|
|
|
|
.ok()
|
|
|
|
|
.or_else(|| git_commit_hash());
|
|
|
|
|
if let Some(hash) = commit {
|
|
|
|
|
println!("cargo:rustc-env=BOTUI_COMMIT={}", hash);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn git_commit_hash() -> Option<String> {
|
|
|
|
|
let output = std::process::Command::new("git")
|
|
|
|
|
.args(["rev-parse", "--short", "HEAD"])
|
|
|
|
|
.output()
|
|
|
|
|
.ok()?;
|
|
|
|
|
if !output.status.success() {
|
|
|
|
|
return None;
|
|
|
|
|
}
|
|
|
|
|
String::from_utf8(output.stdout).ok().map(|s| s.trim().to_string())
|
2026-04-19 08:14:25 -03:00
|
|
|
}
|