about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2023-12-09 15:19:08 -0500
committerjyn <github@jyn.dev>2023-12-09 15:19:39 -0500
commit520662eb2ac157bf4bfcda83838c9dac89c9daf4 (patch)
treef195b494858eda1b94f86db4d88f207d40372a4b /src/bootstrap
parent2b399b52753eac351067e73f4ff0de829443b9a7 (diff)
fix --dry-run when the change-id warning is printed
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/bin/main.rs2
-rw-r--r--src/bootstrap/src/core/config/config.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs
index 952ef40ed42..3d593392e79 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<String> {
                 "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 22e8ce8365b..02b596f2b5a 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,