Skip to content

Commit

Permalink
fix: save updated config in new path
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed May 22, 2024
1 parent c070fab commit 7f93024
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions provers/sgx/setup/src/setup_bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ pub(crate) async fn setup_bootstrap(
//save to the same file
info!("Saving bootstrap data file {}", config_path.display());
let json = serde_json::to_string_pretty(&file_config)?;
fs::write(&config_path, json).context(format!(
let new_config_path = config_path
.with_extension("")
.with_extension("new")
.with_extension("json");
fs::write(&new_config_path, json).context(format!(
"Saving bootstrap data file {} failed",
config_path.display()
new_config_path.display()
))?;
Ok(())
}

0 comments on commit 7f93024

Please sign in to comment.