more urchin_root
This commit is contained in:
parent
c9af70b947
commit
54b9e5887d
3
tests/Test root contains .urchin./Assess root on a file.
Executable file
3
tests/Test root contains .urchin./Assess root on a file.
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
../../urchin --root .testsuite/a/b/c/testcase
|
2
tests/Test root contains .urchin./Wrong filename
Executable file
2
tests/Test root contains .urchin./Wrong filename
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
../../urchin --root .testsuite/a/not-a-file
|
11
urchin
11
urchin
@ -19,10 +19,13 @@ VERSION=0.0.6
|
||||
urchin_root() {
|
||||
(
|
||||
set -e
|
||||
if test -f "$1"; then
|
||||
set -- $(dirname "$1")
|
||||
fi
|
||||
if test -d "$1"/.urchin; then
|
||||
|
||||
if ! test -e "$1"; then
|
||||
echo "$1: No such file or directory">&2
|
||||
exit 1
|
||||
elif test -f "$1"; then
|
||||
urchin_root $(dirname "$1")
|
||||
elif test -d "$1"/.urchin; then
|
||||
echo "$1"
|
||||
elif test "$(readlink -f $1)" = /; then
|
||||
guess=$(readlink -f "$1"|sed s+\(/tests?/\).*+/tests/+)
|
||||
|
Loading…
Reference in New Issue
Block a user