]> git.sthu.org Git - shutils.git/commitdiff
git: pre-commit-texcheck shall not create file "0"
authorStefan Huber <shuber@sthu.org>
Tue, 28 Jan 2014 09:50:13 +0000 (10:50 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 28 Jan 2014 09:50:13 +0000 (10:50 +0100)
git/pre-commit-texcheck

index 284849f36516ebdb9f76573a1630a56baa61b313..8d47a5ebe3ef566e066cdded54f4914960618a82 100755 (executable)
@@ -2,12 +2,14 @@
 
 set -e
 
-[ "$#" > "0" ] && cd "$1"
+[ "$#" -gt "0" ] && cd "$1"
 
 tmpdir=$(mktemp -d)
 cleanup()
 {
-    rm -r "$tmpdir"
+    if [ -n "$tmpdir" ]; then
+        rm -r "$tmpdir"
+    fi
 }
 
 for f in $(find -name "*.tex"); do