Skip to content

Commit

Permalink
fix: use tv.short in mise prune
Browse files Browse the repository at this point in the history
Fixes #2870
  • Loading branch information
jdx committed Nov 26, 2024
1 parent b200169 commit e95418f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cli/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use eyre::Result;
use crate::backend::Backend;
use crate::cli::args::BackendArg;
use crate::config::tracking::Tracker;
use crate::config::{Config, Settings};
use crate::config::{Config, SETTINGS};
use crate::toolset::{ToolVersion, Toolset, ToolsetBuilder};
use crate::ui::multi_progress_report::MultiProgressReport;
use crate::ui::prompt;
Expand Down Expand Up @@ -87,15 +87,17 @@ impl Prune {
}

fn delete(&self, to_delete: Vec<(Arc<dyn Backend>, ToolVersion)>) -> Result<()> {
let settings = Settings::try_get()?;
let mpr = MultiProgressReport::get();
for (p, tv) in to_delete {
let mut prefix = tv.style();
if self.dry_run {
prefix = format!("{} {} ", prefix, style("[dryrun]").bold());
}
let pr = mpr.add(&prefix);
if self.dry_run || settings.yes || prompt::confirm(format!("remove {} ?", &tv))? {
if self.dry_run
|| SETTINGS.yes
|| prompt::confirm_with_all(format!("remove {} ?", &tv))?
{
p.uninstall_version(&tv, pr.as_ref(), self.dry_run)?;
pr.finish();
}
Expand Down

0 comments on commit e95418f

Please sign in to comment.