safer tmpdir

may fix cygwin/osx
This commit is contained in:
Casper da Costa-Luis 2020-07-20 16:49:54 +01:00
parent b8d75f6000
commit dd6a8c4c2b
No known key found for this signature in database
GPG key ID: D88C553DBD362CDE

View file

@ -64,7 +64,9 @@ command_exists() {
}
get_tmp_dir() {
echo "${TMPDIR:-/tmp}/tmux-$EUID-cpu"
local tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
[ -d "$tmpdir" ] || local tmpdir=~/tmp
echo "$tmpdir/tmux-$EUID-cpu"
}
get_time() {