From d3048af163931127fff9686ce0ae7a4f701ec7f2 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:31:23 +0100 Subject: [PATCH] fix: use TENDERDASH_COMMITISH env var if set --- proto/build.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proto/build.rs b/proto/build.rs index dd0eb6f1..41c909c0 100644 --- a/proto/build.rs +++ b/proto/build.rs @@ -3,10 +3,17 @@ use std::env; fn main() { let version = env!("CARGO_PKG_VERSION"); - env::set_var("TENDERDASH_COMMITISH", "v".to_owned() + version); + // check if TENDERDASH_COMMITISH is alrady set; if not, set it to the current + // version + let commitish = env::var("TENDERDASH_COMMITISH").unwrap_or_default(); + if commitish.is_empty() { + env::set_var("TENDERDASH_COMMITISH", "v".to_owned() + version); + } + tenderdash_proto_compiler::proto_compile(); println!("cargo:rerun-if-changed=../proto-compiler/src"); println!("cargo:rerun-if-changed=Cargo.toml"); println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION"); + println!("cargo:rerun-if-env-changed=TENDERDASH_COMMITISH"); }