Skip to content

Commit

Permalink
prune: ignore non-symlinks in tracked config files (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Nov 18, 2023
1 parent 5372bef commit 0604e91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ impl Prune {
if self.dry_run {
pr.set_prefix(format!("{} {} ", pr.prefix(), style("[dryrun]").bold()));
}
if config.settings.yes || prompt::confirm(&format!("remove {} ?", &tv))? {
if self.dry_run || config.settings.yes || prompt::confirm(&format!("remove {} ?", &tv))?
{
p.decorate_progress_bar(&mut pr, Some(&tv));
p.uninstall_version(config, &tv, &pr, self.dry_run)?;
pr.finish();
Expand Down
3 changes: 3 additions & 0 deletions src/config/tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ impl Tracker {
let mut output = vec![];
for path in read_dir(&self.tracking_dir)? {
let path = path?.path();
if !path.is_symlink() {
continue;
}
let path = fs::read_link(path)?;
if path.exists() {
output.push(path);
Expand Down

0 comments on commit 0604e91

Please sign in to comment.