]> git.scottworley.com Git - pinch/blobdiff - tests/lib/test-setup.sh
tests: Depend upon /bin/sh supporting traps
[pinch] / tests / lib / test-setup.sh
index 12cf525878a65dfbea6b14f095192098dc4d7c7d..4ccc8d9277e11d20f325fd2cb2edcc122b45fc5b 100644 (file)
@@ -21,6 +21,9 @@ EOF
 
 }
 
 
 }
 
-foo_cleanup() {
-  rm -rf "$repo_dir" "$conf"
+test_cleanup() {
+  if [ "$repo_dir"  ];then rm -rf "$repo_dir";  fi
+  if [ "$conf"      ];then rm     "$conf";      fi
 }
 }
+
+trap test_cleanup EXIT INT TERM