Skip to content

Commit

Permalink
fix(forge create): install missing deps if any (#9401)
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy authored Nov 25, 2024
1 parent cca72ab commit 66228e4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::cmd::install;
use alloy_chains::Chain;
use alloy_dyn_abi::{DynSolValue, JsonAbiExt, Specifier};
use alloy_json_abi::{Constructor, JsonAbi};
Expand Down Expand Up @@ -98,7 +99,14 @@ pub struct CreateArgs {
impl CreateArgs {
/// Executes the command to create a contract
pub async fn run(mut self) -> Result<()> {
let config = self.try_load_config_emit_warnings()?;
let mut config = self.try_load_config_emit_warnings()?;

// Install missing dependencies.
if install::install_missing_dependencies(&mut config) && config.auto_detect_remappings {
// need to re-configure here to also catch additional remappings
config = self.load_config();
}

// Find Project & Compile
let project = config.project()?;

Expand Down

0 comments on commit 66228e4

Please sign in to comment.