Skip to content

Commit

Permalink
evaluate .env in Anvil, like we do in other binaries (#7344)
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks authored Mar 8, 2024
1 parent 345858f commit 12cbf67
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ path = "src/anvil.rs"
required-features = ["cli"]

[build-dependencies]
vergen = { workspace = true, default-features = false, features = ["build", "git", "gitcl"] }
vergen = { workspace = true, default-features = false, features = [
"build",
"git",
"gitcl",
] }

[dependencies]
# foundry internal
anvil-core = { path = "core", features = ["serde", "impersonated-tx"] }
anvil-rpc = { path = "rpc" }
anvil-server = { path = "server" }
foundry-cli.workspace = true
foundry-common.workspace = true
foundry-config.workspace = true
foundry-evm.workspace = true
Expand Down Expand Up @@ -76,7 +81,11 @@ rand = "0.8"
eyre.workspace = true

# cli
clap = { version = "4", features = ["derive", "env", "wrap_help"], optional = true }
clap = { version = "4", features = [
"derive",
"env",
"wrap_help",
], optional = true }
clap_complete = { version = "4", optional = true }
chrono.workspace = true
auto_impl = "1"
Expand Down
4 changes: 4 additions & 0 deletions crates/anvil/src/anvil.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! The `anvil` cli
use anvil::cmd::NodeArgs;
use clap::{CommandFactory, Parser, Subcommand};
use foundry_cli::utils;

/// A fast local Ethereum development node.
#[derive(Parser)]
Expand Down Expand Up @@ -29,6 +31,8 @@ pub enum AnvilSubcommand {

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
utils::load_dotenv();

let mut app = Anvil::parse();
app.node.evm_opts.resolve_rpc_alias();

Expand Down

0 comments on commit 12cbf67

Please sign in to comment.