[utility] fix safe-rm alias

Alternative approach to determine if aliasing safe-rm is viable.

If safe-rmdir is available, the OS is Suse (which has it's own safe-rm).
Note to Suse: you're making problems for me. Stop.

Closes #27
This commit is contained in:
Matt Hamilton 2016-01-23 19:45:55 -05:00
parent 5ff931065f
commit 474715170b
1 changed files with 3 additions and 5 deletions

View File

@ -92,11 +92,9 @@ if [[ ${OSTYPE} == linux* ]]; then
fi
# not aliasing rm -i, but if safe-rm is available, use condom.
if (( ${+commands[safe-rm]} )); then
# check that it's the condom safe-rm, not the 'abs path' safe-rm
if [[ $(file =safe-rm | grep 'perl') ]]; then
alias rm='safe-rm'
fi
# if safe-rmdir is available, the OS is suse which has its own terrible 'safe-rm' which is not what we want
if (( ${+commands[safe-rm]} )) && (( ! ${+commands[safe-rmdir]} )); then
alias rm='safe-rm'
fi