chore: optimize common_version build (#4611)

This commit is contained in:
fys
2024-08-23 20:36:28 +08:00
committed by GitHub
parent 2c731c76ad
commit 3973d6b01f

View File

@@ -19,7 +19,11 @@ use build_data::{format_timestamp, get_source_time};
use shadow_rs::{CARGO_METADATA, CARGO_TREE};
fn main() -> shadow_rs::SdResult<()> {
println!("cargo:rerun-if-changed=../../../.git/refs/heads");
println!(
"cargo:rerun-if-changed={}/.git/refs/heads",
env!("CARGO_RUSTC_CURRENT_DIR")
);
println!(
"cargo:rustc-env=SOURCE_TIMESTAMP={}",
if let Ok(t) = get_source_time() {