From 5e2ecab59249c4df8c9d995d76b6c81a86c8bf26 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Thu, 7 Apr 2016 01:58:34 +0000 Subject: [PATCH] mktemp --- urchin | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/urchin b/urchin index e44e63f..de6ff30 100755 --- a/urchin +++ b/urchin @@ -91,8 +91,17 @@ validate_test_arg() { } # All temporary files go here -urchin_tmp=$(mktemp -d) +urchin_tmp=$(mktemp) + +# Support HP-UX mktemp that has wrong exit codes and +# can't make directories. +if test -f "${urchin_tmp}"; then + rm "${urchin_tmp}" +fi +mkdir "${urchin_tmp}" + > "${urchin_tmp}/log" + urchin_exit() { rm -Rf "${urchin_tmp}" exit "$@"