From: Jason Ish Date: Wed, 17 Jan 2018 12:37:37 +0000 (-0600) Subject: clean: test that we are in a verify directory X-Git-Tag: suricata-6.0.4~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8477cab9b969c82fe02733865c0040c54cbde21f;p=thirdparty%2Fsuricata-verify.git clean: test that we are in a verify directory --- diff --git a/clean.sh b/clean.sh index 57d686392..f6cc453c5 100755 --- a/clean.sh +++ b/clean.sh @@ -1,6 +1,18 @@ #! /bin/sh +# +# Remove output directory from all tests. + +set -e prefix=$(dirname $0) -find "${prefix}" -type d -name output -print0 | xargs -0 rm -rf +if ! test -e "${prefix}/run.py" -a -d "${prefix}/tests"; then + echo "error: this doesn't look like a suricata-verify directory." + exit 1 +fi + +# Remove the output directories. +find "${prefix}/tests" -type d -name output -print0 | xargs -0 rm -rf + +# Remove emacs backup files. find "${prefix}" -name \*~ -print0 | xargs -0 rm -f