Skip to content

Commit ae05591

Browse files
committed
Force initializing ExecutionContext with verbosity and fail_fast mode
1 parent ddd2a54 commit ae05591

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,7 @@ impl Config {
454454
} = flags;
455455

456456
let mut config = Config::default_opts();
457-
let mut exec_ctx = ExecutionContext::new();
458-
exec_ctx.set_verbose(flags_verbose);
459-
exec_ctx.set_fail_fast(flags_cmd.fail_fast());
457+
let exec_ctx = ExecutionContext::new(flags_verbose, flags_cmd.fail_fast());
460458

461459
config.exec_ctx = exec_ctx;
462460

src/bootstrap/src/utils/exec.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl Default for CommandOutput {
550550
#[derive(Clone, Default)]
551551
pub struct ExecutionContext {
552552
dry_run: DryRun,
553-
verbose: u8,
553+
verbosity: u8,
554554
pub fail_fast: bool,
555555
delayed_failures: Arc<Mutex<Vec<String>>>,
556556
command_cache: Arc<CommandCache>,
@@ -603,8 +603,8 @@ impl CommandCache {
603603
}
604604

605605
impl ExecutionContext {
606-
pub fn new() -> Self {
607-
ExecutionContext::default()
606+
pub fn new(verbosity: u8, fail_fast: bool) -> Self {
607+
Self { verbosity, fail_fast, ..Default::default() }
608608
}
609609

610610
pub fn dry_run(&self) -> bool {
@@ -629,7 +629,7 @@ impl ExecutionContext {
629629
}
630630

631631
pub fn is_verbose(&self) -> bool {
632-
self.verbose > 0
632+
self.verbosity > 0
633633
}
634634

635635
pub fn fail_fast(&self) -> bool {
@@ -641,7 +641,7 @@ impl ExecutionContext {
641641
}
642642

643643
pub fn set_verbose(&mut self, value: u8) {
644-
self.verbose = value;
644+
self.verbosity = value;
645645
}
646646

647647
pub fn set_fail_fast(&mut self, value: bool) {

0 commit comments

Comments
 (0)