Skip to content

Commit

Permalink
Merge pull request #2260 from joshuef/CleanRegistry
Browse files Browse the repository at this point in the history
fix(nodeman): clean should remove the local node register
  • Loading branch information
joshuef authored Oct 17, 2024
2 parents 7e1027d + 993635b commit af26fa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sn_node_manager/src/cmd/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,19 @@ pub async fn run(
// been killed, which clears it out.
let local_node_reg_path = &get_local_node_registry_path()?;
let mut local_node_registry: NodeRegistry = if clean {
debug!("Clean set to true, removing client, node dir and killing the network.");
debug!(
"Clean set to true, removing client, node dir, local registry and killing the network."
);
let client_data_path = dirs_next::data_dir()
.ok_or_else(|| eyre!("Could not obtain user's data directory"))?
.join("safe")
.join("client");
if client_data_path.is_dir() {
std::fs::remove_dir_all(client_data_path)?;
}
if local_node_reg_path.exists() {
std::fs::remove_file(local_node_reg_path)?;
}
kill(false, verbosity)?;
NodeRegistry::load(local_node_reg_path)?
} else {
Expand Down

0 comments on commit af26fa8

Please sign in to comment.