Skip to content

Commit

Permalink
fix(cli): do not fail on build vergen error (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Sep 20, 2023
1 parent f88052b commit 939ae58
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ use std::{env, error::Error};
use vergen::EmitBuilder;

fn main() -> Result<(), Box<dyn Error>> {
match env::var("BENDSQL_BUILD_INFO") {
Ok(info) => {
EmitBuilder::builder()
.fail_on_error()
.build_timestamp()
.git_sha(true)
.emit()
.unwrap_or_else(|_| {
let info = match env::var("BENDSQL_BUILD_INFO") {
Ok(info) => info,
Err(_) => "unknown".to_string(),
};
println!("cargo:rustc-env=BENDSQL_BUILD_INFO={}", info);
}
Err(_) => {
EmitBuilder::builder()
.fail_on_error()
.build_timestamp()
.git_sha(true)
.emit()?;
}
}
});
Ok(())
}

0 comments on commit 939ae58

Please sign in to comment.