about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-06-24 20:26:46 +0200
committerGitHub <noreply@github.com>2023-06-24 20:26:46 +0200
commit6b337684ed0ea02840ee4852f9d99d71087544a8 (patch)
treefc8c24ed13fd5797a72a7f239fbf72913c818f43
parent9e0f427e5caf928692738505710c06a03eafb26f (diff)
parentce326918ec0d66b5460ef343553f2e99f3880283 (diff)
downloadrust-6b337684ed0ea02840ee4852f9d99d71087544a8.tar.gz
rust-6b337684ed0ea02840ee4852f9d99d71087544a8.zip
Rollup merge of #113002 - camelid:bootstrap-settings.bak, r=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``
-rw-r--r--src/bootstrap/setup.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs
index 7eb70de91f8..9811cf163e5 100644
--- a/src/bootstrap/setup.rs
+++ b/src/bootstrap/setup.rs
@@ -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"