stop urchin_root at hidden directories

This commit is contained in:
Thomas Levine 2016-02-28 22:49:57 +00:00
parent 3e90e83237
commit c6e1016b80
1 changed files with 4 additions and 2 deletions

6
urchin
View File

@ -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