From 287fd8a37cac7c38346278765ff600458f52af79 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sun, 10 Apr 2016 15:50:18 +0000 Subject: [PATCH] use new contains --- urchin | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/urchin b/urchin index bf2017c..58deede 100755 --- a/urchin +++ b/urchin @@ -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,