Skip to content

Commit

Permalink
fix: take settings backup only if migration required (#4077)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs authored Oct 6, 2023
1 parent eac0b4a commit 309f284
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/src/settings_migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ pub fn migrate_settings0_9_2_to_0_9_3(config_root: String) -> Result<()> {
return Ok(())
}

std::fs::copy(settings_file.clone(), settings_file.with_extension("toml.0_9_2.backup"))
.context("Unable to create backup of Settings.toml")?;

let old_settings_table = std::fs::read_to_string(&settings_file)
.context("Unable to read Settings.toml for migration")?
.parse::<Table>()?;
Expand Down Expand Up @@ -70,6 +67,9 @@ pub fn migrate_settings0_9_2_to_0_9_3(config_root: String) -> Result<()> {
return Ok(())
}

std::fs::copy(settings_file.clone(), settings_file.with_extension("toml.0_9_2.backup"))
.context("Unable to create backup of Settings.toml")?;

tracing::info!("Migrating settings to 0.9.3");

let mut new_settings_table = old_settings_table.clone();
Expand Down

0 comments on commit 309f284

Please sign in to comment.