simpler urchin root

This commit is contained in:
Thomas Levine 2016-02-27 14:41:37 +00:00
parent 83af249dcd
commit c9af70b947
4 changed files with 10 additions and 8 deletions

View File

@ -0,0 +1,6 @@
#!/bin/sh
observed=$(../../urchin "$1" .testsuite/a/b)
expected=.testsuite/a/b/../..
test "$observed" = "$expected"

View File

@ -1,6 +1,2 @@
#!/bin/sh
observed=$(../../urchin --root .testsuite/a/b)
expected=.testsuite/a/b/../..
test "$observed" = "$expected"
./.meta-assess --root

View File

@ -0,0 +1,2 @@
#!/bin/sh
./.meta-assess -r

4
urchin
View File

@ -22,8 +22,7 @@ urchin_root() {
if test -f "$1"; then
set -- $(dirname "$1")
fi
cd "$1"
if test -d .urchin; then
if test -d "$1"/.urchin; then
echo "$1"
elif test "$(readlink -f $1)" = /; then
guess=$(readlink -f "$1"|sed s+\(/tests?/\).*+/tests/+)
@ -33,7 +32,6 @@ maybe like this:
mkdir '$guess'/.urchin
" >&2
else
cd - > /dev/null
urchin_root "$1"/..
fi
)