Skip to content

Commit

Permalink
Rollup merge of rust-lang#113002 - camelid:bootstrap-settings.bak, r=…
Browse files Browse the repository at this point in the history
…jyn514

bootstrap: Backup `settings.json` to the correct filename

The old code actually replaced `.json` with `.bak` (so, `settings.bak`),
rather than appending `.bak` as claimed (`settings.json.bak`).

`Path::set_extension` can instead be used with dots:

> The new extension may contain dots and will be used in its entirety,
> but only the part after the final dot will be reflected in
> `self.extension`.

r? `@jyn514`
  • Loading branch information
GuillaumeGomez authored Jun 24, 2023
2 parents 8ebe716 + ce32691 commit c0fbc45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ fn create_vscode_settings_maybe(config: &Config) -> io::Result<()> {
Some(false) => {
// exists and is not current version or outdated, so back it up
let mut backup = vscode_settings.clone();
backup.set_extension("bak");
backup.set_extension("json.bak");
eprintln!("warning: copying `settings.json` to `settings.json.bak`");
fs::copy(&vscode_settings, &backup)?;
"Updated"
Expand Down

0 comments on commit c0fbc45

Please sign in to comment.