From e9d6b73dbd62f0e8fb17251c02e94eae74d06a42 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sat, 27 Feb 2016 17:13:55 +0000 Subject: [PATCH] urchin_root --- urchin | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/urchin b/urchin index 992c70a..cb1f394 100755 --- a/urchin +++ b/urchin @@ -28,12 +28,14 @@ urchin_root() { if ! test -e "$current"; then echo "$current: No such file or directory">&2 - exit 1 + return 1 elif test -f "$current"; then urchin_root "$(dirname "$current")" "$orig" elif test -d "$current"/.urchin; then echo "$current" - elif test "$(readlink -f "$current")" = /; then + elif test "$(readlink -f "$current")" = / || + echo "$current" | grep '^\.' ; then + # Stop traversing upwards at / and at hidden directories. if test -d "$orig"; then origdir="$orig" else