Skip to content

Commit

Permalink
bug fix: allow removing symlinks to dirs without -rf
Browse files Browse the repository at this point in the history
  • Loading branch information
zwimer committed Nov 24, 2023
1 parent 694584c commit 78c4a7e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions delayed_rm/delayed_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os


__version__ = "2.3.0"
__version__ = "2.3.1"


#
Expand Down Expand Up @@ -62,12 +62,13 @@ def validate_paths(paths: List[Path], rf: bool) -> bool:
eprint("duplicate items passed")
return False
for i in paths:
if not i.exists() and not i.is_symlink():
eprint(f"{i} does not exist")
return False
elif not rf and i.is_dir():
eprint(f"{i} is a directory. -rf required!")
return False
if not i.is_symlink():
if not i.exists():
eprint(f"{i} does not exist")
return False
elif not rf and i.is_dir():
eprint(f"{i} is a directory. -rf required!")
return False
return True


Expand Down

0 comments on commit 78c4a7e

Please sign in to comment.