From: Stefan Huber Date: Tue, 28 Jan 2014 09:50:13 +0000 (+0100) Subject: git: pre-commit-texcheck shall not create file "0" X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=874fac4e15be441861de05fca98ac714bb679ae3;p=shutils.git git: pre-commit-texcheck shall not create file "0" --- diff --git a/git/pre-commit-texcheck b/git/pre-commit-texcheck index 284849f..8d47a5e 100755 --- a/git/pre-commit-texcheck +++ b/git/pre-commit-texcheck @@ -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