Skip to content

Commit e09147e

Browse files
authored
feat(scripts): add flag to skip interactivity (foundry-rs#5590)
* chore: add flag to skip interactivity * chore: docs * chore: add eip-170 size limit info
1 parent 29435c9 commit e09147e

File tree

1 file changed

+8
-0
lines changed
  • cli/src/cmd/forge/script

1 file changed

+8
-0
lines changed

cli/src/cmd/forge/script/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ pub struct ScriptArgs {
175175
#[clap(long)]
176176
pub slow: bool,
177177

178+
/// Disables interactive prompts that might appear when deploying big contracts.
179+
///
180+
/// For more info on the contract size limit, see EIP-170: <https://eips.ethereum.org/EIPS/eip-170>
181+
#[clap(long)]
182+
pub non_interactive: bool,
183+
178184
/// The Etherscan (or equivalent) API key
179185
#[clap(long, env = "ETHERSCAN_API_KEY", value_name = "KEY")]
180186
pub etherscan_api_key: Option<String>,
@@ -624,7 +630,9 @@ impl ScriptArgs {
624630
}
625631
}
626632

633+
// Only prompt if we're broadcasting and we've not disabled interactivity.
627634
if prompt_user &&
635+
!self.non_interactive &&
628636
!Confirm::new().with_prompt("Do you wish to continue?".to_string()).interact()?
629637
{
630638
eyre::bail!("User canceled the script.");

0 commit comments

Comments
 (0)