From 347f17f0f9e3bc791d1fd699467da9fef4dab8ff Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 2 Dec 2025 15:35:27 +0000 Subject: landing page add commit hash to version and add curation --- build.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..e7d9cba --- /dev/null +++ b/build.rs @@ -0,0 +1,20 @@ +use std::process::Command; + +fn main() { + // Get the short git commit hash + let output = Command::new("git") + .args(["rev-parse", "--short", "HEAD"]) + .output(); + + if let Ok(output) = output { + if output.status.success() { + let commit = String::from_utf8_lossy(&output.stdout); + let commit = commit.trim(); + println!("cargo:rustc-env=GIT_COMMIT_SHORT={}", commit); + } + } + + // Re-run if HEAD changes (new commits) + println!("cargo:rerun-if-changed=.git/HEAD"); + println!("cargo:rerun-if-changed=.git/refs/heads/"); +} \ No newline at end of file -- cgit v1.2.3