[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:
parent
5ff931065f
commit
474715170b
1 changed files with 3 additions and 5 deletions
|
@ -92,11 +92,9 @@ if [[ ${OSTYPE} == linux* ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# not aliasing rm -i, but if safe-rm is available, use condom.
|
# not aliasing rm -i, but if safe-rm is available, use condom.
|
||||||
if (( ${+commands[safe-rm]} )); then
|
# if safe-rmdir is available, the OS is suse which has its own terrible 'safe-rm' which is not what we want
|
||||||
# check that it's the condom safe-rm, not the 'abs path' safe-rm
|
if (( ${+commands[safe-rm]} )) && (( ! ${+commands[safe-rmdir]} )); then
|
||||||
if [[ $(file =safe-rm | grep 'perl') ]]; then
|
alias rm='safe-rm'
|
||||||
alias rm='safe-rm'
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue