fix --dry-run when the change-id warning is printed

This commit is contained in:
jyn 2023-12-09 15:19:08 -05:00
parent 2b399b5275
commit 520662eb2a
2 changed files with 2 additions and 2 deletions

View file

@ -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()));
}
}

View file

@ -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,