blob: 41fab30008f7024c1a62f21c5765906690d9bf4b [file] [log] [blame] [edit]
#!/bin/bash
TMPDIR="$(mktemp -d --tmpdir "${TMPTMPL-tmp.XXXXXXXXXX}")" || exit
function rmtmp() {
if [ -n "${TMP_DEBUG-}" ]; then
echo "Removing TMPDIR=$TMPDIR" >&2
fi
rm -rf -- "$TMPDIR"
}
trap rmtmp EXIT
export TMPDIR
if [ -n "${TMP_DEBUG-}" ]; then
echo "Exec $* with TMPDIR=$TMPDIR" >&2
fi
"$@"