Skip to content

Commit

Permalink
fix(proto-compiler): better detection of missing protobuf files
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Mar 15, 2024
1 parent 86ba24b commit b93b1ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions proto-compiler/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,7 @@ pub(crate) fn check_state(dir: &Path, commitish: &str) -> bool {

match read_to_string(state_file) {
Ok(content) => {
println!(
"[info] => Found previously downloaded Tenderdash {}.",
content.trim()
);
println!("[info] => Detected Tenderdash version: {}.", content.trim());
content.eq(commitish)
},
Err(_) => false,
Expand Down
3 changes: 2 additions & 1 deletion proto-compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ pub fn proto_compile() {
let commitish = tenderdash_commitish();

// check if this commitish is already downloaded
let download = !check_state(&prost_out_dir, &commitish);
let download = std::fs::metadata(tenderdash_dir.join("proto")).is_err()
|| !check_state(&prost_out_dir, &commitish);

if download {
println!("[info] => Fetching {TENDERDASH_REPO} at {commitish} into {tenderdash_dir:?}.");
Expand Down

0 comments on commit b93b1ed

Please sign in to comment.