Skip to content

Commit

Permalink
fix: use TENDERDASH_COMMITISH env var if set
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Dec 14, 2023
1 parent 6401145 commit e343a0b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit e343a0b

Please sign in to comment.