use new contains

This commit is contained in:
Thomas Levine 2016-04-10 15:50:18 +00:00
parent 9ce5c45bed
commit 287fd8a37c
1 changed files with 5 additions and 5 deletions

10
urchin
View File

@ -283,7 +283,7 @@ urchin_root() {
abscurrent="$(fullpath "${1}")"
if test "${abscurrent}" = / ||
basename "${abscurrent}" | grep -q '^\.' ; then
basename "${abscurrent}" | contains '^\.' ; then
# Stop traversing upwards at / and at hidden directories.
if test -d "${orig}"; then
echo "${orig}"
@ -315,8 +315,8 @@ recurse() {
fi
done
if contains "${potential_test}" "^${potential_test}" ||
contains "${potential_test}" "^${requested_path}" ; then
if contains "${potential_test}" \
"^${potential_test}" "^${requested_path}" ; then
if test "$(dirname "${potential_test}")" = \
"$(dirname "${requested_path}")" &&
test "${potential_test}" != "${requested_path}"; then
@ -335,7 +335,7 @@ recurse() {
if [ -d "${potential_test}" ]; then
(
cd -- "${potential_test}"
if test -f .urchin_dir && grep -q series .urchin_dir ; then
if test -f .urchin_dir && grep series .urchin_dir > /dev/null; then
run_in_series_dir=true
else
run_in_series_dir=false
@ -670,7 +670,7 @@ validate_test_arg() {
root="$(urchin_root "${1}")"
if ! {
basename "$(fullpath "${root}")" |
grep -qi 'test' || "${force}"
grep -i 'test' > /dev/null || "${force}"
}; then
echo 'The root directory of the tests that you are running urchin on
does not contain the word "test", so I am not running,