kaelzhang / shell-safe-rm

😎 Safe-rm: A drop-in and much safer replacement of bash rm with nearly full functionalities and options of the rm command! Safe-rm will act exactly the same as the original rm command.
Other
428 stars 33 forks source link

⚠️ Running this will frequently delete the parent directory ⚠️ #28

Open wparad opened 2 years ago

wparad commented 2 years ago

If you run this executable occasionally it will decide to delete the current working directory as well as the target.

I'm almost positive it was happening when running safe-rm CHILD_DIRECTORY -rf or safe-rm ./CHILD_DIRECTORY -rf, but I often would only find out ~10 minutes later that it happened when doing development that the directory I was in was no longer available. Or maybe it was putting the -rf first that caused the problem. One of these was the issue.

adoyle-h commented 1 year ago

How to reproduce this issue?

wparad commented 1 year ago

I'm almost positive it was happening when running safe-rm CHILD_DIRECTORY -rf or safe-rm ./CHILD_DIRECTORY -rf, but I often would only find out ~10 minutes later that it happened when doing development that the directory I was in was no longer available. Or maybe it was putting the -rf first that caused the problem. One of these was the issue.