diff --git a/scripts/functions/cleanup b/scripts/functions/cleanup index 71050077c6..f349410435 100644 --- a/scripts/functions/cleanup +++ b/scripts/functions/cleanup @@ -8,13 +8,14 @@ __rvm_rm_rf() local result=1 target="${1%%+(/|.)}" #NOTE: RVM Requires extended globbing shell feature turned on. + shopt -s extglob case "${target}" in (*(/|.)@(|/Applications|/Developer|/Guides|/Information|/Library|/Network|/System|/User|/Users|/Volumes|/backups|/bdsm|/bin|/boot|/cores|/data|/dev|/etc|/home|/lib|/lib64|/mach_kernel|/media|/misc|/mnt|/net|/opt|/private|/proc|/root|/sbin|/selinux|/srv|/sys|/tmp|/usr|/var)) false ;; - *) + (*) if [[ -n "${target}" ]] ; then if [[ -d "${target}" ]] ; then # Directory