Skip to content

Commit

Permalink
added purging all existing IDF installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Gadorek committed Nov 27, 2024
1 parent af70bc9 commit 246ff61
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,26 @@ async fn main() {
}
}
Commands::Purge => {
// Implement complete purge
println!("Purging all installations...");
unimplemented!();
// Todo: offer to run discovery first
println!("Purging all IDF installations...");
match idf_im_lib::version_manager::list_installed_versions() {
Ok(versions) => {
if versions.len() == 0 {
println!("No versions installed");
} else {
for version in versions {
println!("Removing version: {}", version.name);
match remove_single_idf_version(&version.name) {
Ok(_) => {
println!("Removed version: {}", version.name);
}
Err(err) => error!("Error: {}", err),
}
}
}
}
Err(err) => error!("Error: {}", err),
}
}
}
}

0 comments on commit 246ff61

Please sign in to comment.