Skip to content

Commit

Permalink
fix --dry-run when the change-id warning is printed
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Dec 9, 2023
1 parent 2b399b5 commit 520662e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 520662e

Please sign in to comment.