use std::process::Command; // Stamp the GUI with the same git build id as the bundled daemon so the bridge // can detect and restart a stale running daemon. Matches crates/spaceshd/build.rs. fn main() { println!("cargo:rustc-env=SPACESH_BUILD={}", git_build()); println!("cargo:rerun-if-changed=../../.git/HEAD"); println!("cargo:rerun-if-changed=../../.git/index"); tauri_build::build() } fn git_build() -> String { let sha = Command::new("git") .args(["rev-parse", "--short=12", "HEAD"]) .output() .ok() .filter(|o| o.status.success()) .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) .filter(|s| !s.is_empty()); let Some(sha) = sha else { return "dev".into() }; let dirty = Command::new("git") .args(["status", "--porcelain"]) .output() .ok() .map(|o| !o.stdout.is_empty()) .unwrap_or(false); if dirty { format!("{sha}-dirty") } else { sha } }