Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/cli/test_unuse
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

assert "mise install [email protected]"
assert "mise rm dummy"
assert "mise ls" ""
assert_empty "mise ls"

assert "mise use [email protected]"
assert_contains "mise ls dummy" "1.0.0"
Expand Down
19 changes: 6 additions & 13 deletions src/cli/unuse.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use eyre::Result;

use crate::cli::args::ToolArg;
use crate::cli::prune::prune;
use crate::config;
use crate::config::config_file::ConfigFile;
use crate::config::{config_file, Config};
use crate::file::display_path;
use eyre::Result;
use itertools::Itertools;

/// Removes installed tool versions from mise.toml
///
Expand Down Expand Up @@ -40,18 +40,11 @@ impl Unuse {
}
if removed.is_empty() {
debug!("no tools to remove");
return Ok(());
} else {
cf.save()?;
let removals = removed.iter().join(", ");
info!("removed: {removals} from {}", display_path(cf.get_path()));
}
cf.save()?;
info!(
"removed: {} from {}",
removed
.iter()
.map(|ta| ta.to_string())
.collect::<Vec<_>>()
.join(", "),
display_path(cf.get_path())
);

if !self.no_prune {
prune(self.installed_tool.iter().map(|ta| &ta.ba).collect(), false)?;
Expand Down
3 changes: 3 additions & 0 deletions src/config/tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ impl Tracker {

pub fn list_all() -> Result<Vec<PathBuf>> {
let mut output = vec![];
if !TRACKED_CONFIGS.exists() {
return Ok(output);
}
for path in read_dir(&*TRACKED_CONFIGS)? {
let path = path?.path();
if !path.is_symlink() {
Expand Down
Loading