Skip to content

Commit

Permalink
fix(forge/run): fix branching for if no target contract specified (fo…
Browse files Browse the repository at this point in the history
  • Loading branch information
meetmangukiya authored Mar 31, 2022
1 parent fbd7279 commit b8125de
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cli/src/cmd/forge/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,15 @@ impl RunArgs {
} = post_link_input;

// if it's the target contract, grab the info
if extra.no_target_name && id.source == std::path::Path::new(&extra.target_fname) {
if extra.matched {
eyre::bail!("Multiple contracts in the target path. Please specify the contract name with `-t ContractName`")
if extra.no_target_name {
if id.source == std::path::Path::new(&extra.target_fname) {
if extra.matched {
eyre::bail!("Multiple contracts in the target path. Please specify the contract name with `-t ContractName`")
}
*extra.dependencies = dependencies;
*extra.contract = contract.clone();
extra.matched = true;
}
*extra.dependencies = dependencies;
*extra.contract = contract.clone();
extra.matched = true;
} else {
let split: Vec<&str> = extra.target_fname.split(':').collect();
let path = std::path::Path::new(split[0]);
Expand Down

0 comments on commit b8125de

Please sign in to comment.