Skip to content

Commit

Permalink
set env var at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Aug 7, 2024
1 parent 52ab1aa commit 39335b4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions zero_bin/verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ use zero_bin_common::version;
mod cli;
mod init;

const EVM_ARITHMETIZATION_PKG_VER: &str = "EVM_ARITHMETIZATION_PKG_VER";

fn main() -> Result<()> {
dotenv().ok();
init::tracing();

if env::var_os(EVM_ARITHMETIZATION_PKG_VER).is_none() {
// Safety:
// - we're early enough in main that nothing else should race
unsafe {
env::set_var(
EVM_ARITHMETIZATION_PKG_VER,
env!("EVM_ARITHMETIZATION_PKG_VER"),
);
}
}

let args: Vec<String> = env::args().collect();
if args.contains(&"--version".to_string()) {
version::print_version(
Expand Down

0 comments on commit 39335b4

Please sign in to comment.