From 21e47c7a340a530e61fa3bebf024169a0f540845 Mon Sep 17 00:00:00 2001 From: xphoniex Date: Wed, 23 Nov 2022 08:25:10 +0000 Subject: [PATCH] cli: Use the build.rs at root Signed-off-by: xphoniex --- radicle-cli/Cargo.toml | 1 + radicle-cli/build.rs | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 radicle-cli/build.rs diff --git a/radicle-cli/Cargo.toml b/radicle-cli/Cargo.toml index f5382495..de4314d4 100644 --- a/radicle-cli/Cargo.toml +++ b/radicle-cli/Cargo.toml @@ -4,6 +4,7 @@ license = "MIT OR Apache-2.0" version = "0.8.0" authors = ["Alexis Sellier "] edition = "2021" +build = "../build.rs" [[bin]] name = "rad" diff --git a/radicle-cli/build.rs b/radicle-cli/build.rs deleted file mode 100644 index fc6352c2..00000000 --- a/radicle-cli/build.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::process::Command; - -fn main() { - // Set a build-time `GIT_HEAD` env var which includes the commit id; - // such that we can tell which code is running. - let hash = Command::new("git") - .arg("rev-parse") - .arg("--short") - .arg("HEAD") - .output() - .ok() - .and_then(|output| { - if output.status.success() { - String::from_utf8(output.stdout).ok() - } else { - None - } - }) - .unwrap_or_else(|| String::from("unknown")); - - println!("cargo:rustc-env=GIT_HEAD={}", hash); - println!("cargo:rustc-rerun-if-changed=.git/HEAD"); -}