Skip to content
Browse files

setup/teardown

  • Loading branch information...
1 parent c5d99ae commit 5c2f0a55daec5972118f9056a3f236d8542e0946 @tlevine committed Oct 10, 2012
Showing with 25 additions and 2 deletions.
  1. +4 −1 test/setup
  2. +8 −0 test/setup_dir
  3. +1 −1 test/teardown
  4. +12 −0 test/teardown_dir
View
5 test/setup
@@ -1,4 +1,7 @@
#!/bin/sh
-rm -f ~/.git-achievements*
+# Make a temporary directory.
mkdir -p ./.tmp
+
+# Clear git-achievements files
+rm -f ~/.git-achievements{-action,}.log
View
8 test/setup_dir
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Back up and clear current achievements.
+for file in ~/.git-achievements.log ~/.git-achievements-action.log
+ do
+ [ -e "$file" ] && mv $file{,.bak}
+done
+
View
2 test/teardown 100755 → 100644
@@ -1,3 +1,3 @@
#!/bin/sh
-rm -Rf ./.tmp
+rm -Rf .tmp
View
12 test/teardown_dir
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Restore achievements
+for file in ~/.git-achievements.log ~/.git-achievements-action.log
+ do
+ if [ -e "${file}.bak" ]
+ then
+ mv $file{.bak,}
+ else
+ rm $file
+ fi
+done

0 comments on commit 5c2f0a5

Please sign in to comment.
Something went wrong with that request. Please try again.