From 96e616f06785f4c885ee9c2532a043e620ab07ba Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 30 May 2012 08:46:12 -0400 Subject: add_full_dir: properly handle symlinks and empty dirs Note that we're intentionally very liberal about what we accept for symlinks, and don't actually care if the target exists. Signed-off-by: Dave Reisner --- functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions b/functions index ed6d78d..b37ac87 100644 --- a/functions +++ b/functions @@ -346,9 +346,12 @@ add_full_dir() { if [[ -n $1 && -d $1 ]]; then for f in "$1"/*; do - if [[ -d "$f" ]]; then + if [[ -L $f ]]; then + add_symlink "$f" "$(readlink "$f")" + elif [[ -d $f ]]; then + add_dir "$f" add_full_dir "$f" - else + elif [[ -f $f ]]; then add_file "$f" fi done -- cgit v1.2.3-24-g4f1b