Skip to content

Commit

Permalink
skip prompt on forced-on-disk
Browse files Browse the repository at this point in the history
  • Loading branch information
CAGS295 authored and hugocaillard committed Sep 8, 2023
1 parent bed85d1 commit 0d648e6
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions components/clarinet-cli/src/frontend/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,20 @@ struct ApplyDeployment {
/// Display streams of logs instead of terminal UI dashboard
#[clap(long = "no-dashboard")]
pub no_dashboard: bool,
/// Skip the user confirmation prompt before applying
#[clap(long = "skip-prompt", short = 's')]
pub skip_user_confirmation: bool,
/// Use on disk deployment plan (prevent updates computing)
#[clap(
long = "use-on-disk-deployment-plan",
short = 'd',
conflicts_with = "use-computed-deployment-plan"
)]
pub use_on_disk_deployment_plan: bool,
/// Use computed deployment plan (will overwrite on disk version if any update)
#[clap(
long = "use-computed-deployment-plan",
short = 'c',
conflicts_with = "use-on-disk-deployment-plan"
)]
pub use_computed_deployment_plan: bool,
}

#[derive(Parser, PartialEq, Clone, Debug)]
Expand Down Expand Up @@ -768,7 +779,7 @@ pub fn main() {
Err(format!("{}: a flag `--devnet`, `--testnet`, `--mainnet` or `--deployment-plan-path=path/to/yaml` should be provided.", yellow!("Command usage")))
}
(Some(network), None) => {
let res = load_deployment_if_exists(&manifest, &network, true, false);
let res = load_deployment_if_exists(&manifest, &network, cmd.use_on_disk_deployment_plan, cmd.use_computed_deployment_plan);
match res {
Some(Ok(deployment)) => {
println!(
Expand Down Expand Up @@ -821,7 +832,7 @@ pub fn main() {
DeploymentSynthesis::from_deployment(&deployment)
);

if !cmd.skip_user_confirmation {
if !cmd.use_on_disk_deployment_plan {
println!("{}", yellow!("Continue [Y/n]?"));
let mut buffer = String::new();
std::io::stdin().read_line(&mut buffer).unwrap();
Expand Down

0 comments on commit 0d648e6

Please sign in to comment.