Skip to content

Commit 529047c

Browse files
committed
Auto merge of #118789 - jyn514:dry-run, r=onur-ozkan
fix --dry-run when the change-id warning is printed previously: ``` Building bootstrap Compiling bootstrap v0.0.0 (/home/jyn/src/rust2/src/bootstrap) Finished dev [unoptimized] target(s) in 4.23s thread 'main' panicked at src/bin/main.rs:147:17: fs::write(warned_id_path, latest_change_id.to_string()) failed with No such file or directory (os error 2) ```
2 parents 1aa6aef + 520662e commit 529047c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bootstrap/src/bin/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn check_version(config: &Config) -> Option<String> {
174174
"update `config.toml` to use `change-id = {latest_change_id}` instead"
175175
));
176176

177-
if io::stdout().is_terminal() {
177+
if io::stdout().is_terminal() && !config.dry_run() {
178178
t!(fs::write(warned_id_path, latest_change_id.to_string()));
179179
}
180180
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ impl Config {
19691969
config
19701970
}
19711971

1972-
pub(crate) fn dry_run(&self) -> bool {
1972+
pub fn dry_run(&self) -> bool {
19731973
match self.dry_run {
19741974
DryRun::Disabled => false,
19751975
DryRun::SelfCheck | DryRun::UserSelected => true,

0 commit comments

Comments
 (0)