]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
clean: test that we are in a verify directory
authorJason Ish <ish@unx.ca>
Wed, 17 Jan 2018 12:37:37 +0000 (06:37 -0600)
committerJason Ish <ish@unx.ca>
Wed, 17 Jan 2018 12:37:37 +0000 (06:37 -0600)
clean.sh

index 57d68639236334178d1480347dbec7624ed9f5e9..f6cc453c5a446bbedcc17bfc5c0aa36bae05f571 100755 (executable)
--- 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