From 446353a6a7611b1ad925d5bbe9fac0086096d03b Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sun, 10 Apr 2016 16:02:23 +0000 Subject: [PATCH] parameter expansions --- urchin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/urchin b/urchin index 58deede..b844c6b 100755 --- a/urchin +++ b/urchin @@ -272,9 +272,10 @@ remove_trailing_slash() { echo "$1" | sed s/\\/$// } +# Find the root directory of the present test suite urchin_root() { # Call recursively but remember the original argument. - current="$(remove_trailing_slash "${1}")" + current="${1%/}" if test -n "${2}"; then orig="${2}" else @@ -296,7 +297,7 @@ urchin_root() { elif test -f "${current}"; then urchin_root "$(dirname -- "${current}")" "${orig}" elif test -f "${current}"/.urchin_root; then - remove_trailing_slash "${current}" + echo "${current}" else urchin_root "${current}"/.. "${orig}" fi