From c6e1016b80747eb1b76b5cdd9b9a45aefe9176df Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sun, 28 Feb 2016 22:49:57 +0000 Subject: [PATCH] stop urchin_root at hidden directories --- urchin | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/urchin b/urchin index 4153a40..2e460a0 100755 --- a/urchin +++ b/urchin @@ -50,8 +50,10 @@ urchin_root() { orig="$1" fi - if test "$(readlink -f -- "$1")" = /; then - # Stop traversing upwards at / + abscurrent="$(fullpath "$1")" + if test "$abscurrent" = / || + basename "$abscurrent" | grep '^\.' > /dev/null; then + # Stop traversing upwards at / and at hidden directories. if test -d "$orig"; then echo "$orig" else