blob: 8b8895ad5ac70a892d8ed18a65ed270778996f42 [file] [log] [blame]
#!/bin/bash
TMPDIR="$(mktemp -d --tmpdir "${TMPTMPL-tmp.XXXXXXXXXX}")" || exit
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
"$@"