diff --git a/Cargo.lock b/Cargo.lock index c02afd7..d4da79c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -267,7 +267,7 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "npkl" -version = "1.0.2" +version = "1.0.3" dependencies = [ "byte-unit", "dialoguer", diff --git a/Cargo.toml b/Cargo.toml index a2953f3..566100e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "npkl" -version = "1.0.2" +version = "1.0.3" edition = "2021" description = "Like npkill, but written in Rust." authors=["Val Saven "] @@ -10,7 +10,7 @@ repository = "https://github.com/valsaven/npkl" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -itertools = "0.12.0" +itertools = "0.13.0" byte-unit = "5.1.3" dialoguer = "0.11.0" walkdir = "2.4.0" diff --git a/README.md b/README.md index a0b0271..3c3836f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ This utility recursively searches for node_modules directories from the point it - Review the path and size of each found directory. - Selectively delete unwanted node_modules directories with a simple interface. - ## Building To build it from source you need Rust 1.73 or later, preferably via rustup. @@ -25,6 +24,7 @@ cargo install npkl ### Local Building Clone this repo and then: + ```bash cargo build --release # Optionally, you can compress the executable file (Windows example, reduces the file size from ~338KB to ~123KB): diff --git a/src/main.rs b/src/main.rs index 12ade8c..4f99aaa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,14 +50,18 @@ fn main() -> std::io::Result<()> { println!("{}\n", node_items.len()); let selection_result = MultiSelect::with_theme(&ColorfulTheme::default()) - .with_prompt("Select with CURSORS and SPACE. Press ENTER to delete") + .with_prompt("Select with CURSORS and SPACE. Press ENTER to delete\n") .items(&node_items) + .report(false) + .clear(true) .interact_on_opt(&Term::stderr()); match selection_result { Ok(Some(positions)) => { - for index in positions { - let selected_item = &node_items[index]; + println!("Selected items:"); + for index in &positions { + let selected_item = &node_items[*index]; + println!("{}", selected_item); let selected_item_path = get_selected_item_path(selected_item); fs::remove_dir_all(selected_item_path)?; }