diff --git a/functions b/functions index 20bbffe..fc455c9 100644 --- a/functions +++ b/functions @@ -421,16 +421,31 @@ add_full_dir() { if [[ -n $1 && -d $1 ]]; then add_dir "$1" + local ret=0 for f in "$1"/*; do if [[ -L $f ]]; then - [[ $f = $filter ]] && add_symlink "$f" "$(readlink "$f")" + if [[ $f = $filter ]]; then + add_symlink "$f" "$(readlink "$f")" + let ret=$ret+$? + fi elif [[ -d $f ]]; then add_full_dir "$f" elif [[ -f $f ]]; then - [[ $f = $filter ]] && add_file "$f" + if [[ $f = $filter ]]; then + add_file "$f" + let ret=$ret+$? + fi fi done fi + + # since the trap doesn't get the return code from an explicit return statement, + # +simply setting a return code by this + if [ $ret -gt 0 ]; then + false + else + true + fi } add_dir() {