From 520662eb2ac157bf4bfcda83838c9dac89c9daf4 Mon Sep 17 00:00:00 2001 From: jyn Date: Sat, 9 Dec 2023 15:19:08 -0500 Subject: [PATCH] fix --dry-run when the change-id warning is printed --- src/bootstrap/src/bin/main.rs | 2 +- src/bootstrap/src/core/config/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs index 952ef40ed424d..3d593392e79f4 100644 --- a/src/bootstrap/src/bin/main.rs +++ b/src/bootstrap/src/bin/main.rs @@ -143,7 +143,7 @@ fn check_version(config: &Config) -> Option { "update `config.toml` to use `change-id = {latest_change_id}` instead" )); - if io::stdout().is_terminal() { + if io::stdout().is_terminal() && !config.dry_run() { t!(fs::write(warned_id_path, latest_change_id.to_string())); } } diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 22e8ce8365b1f..02b596f2b5aab 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1741,7 +1741,7 @@ impl Config { config } - pub(crate) fn dry_run(&self) -> bool { + pub fn dry_run(&self) -> bool { match self.dry_run { DryRun::Disabled => false, DryRun::SelfCheck | DryRun::UserSelected => true,