From 474715170b22703fcc7bd265d14d966a77a7d7a5 Mon Sep 17 00:00:00 2001 From: Matt Hamilton Date: Sat, 23 Jan 2016 19:45:55 -0500 Subject: [PATCH] [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 --- modules/utility/init.zsh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index c5dba2a..58aade9 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -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