Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 801a0ce

Browse files
authoredJul 20, 2020
safer tmpdir
may fix cygwin/osx
1 parent b8d75f6 commit 801a0ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

Diff for: ‎scripts/helpers.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ command_exists() {
6464
}
6565

6666
get_tmp_dir() {
67-
echo "${TMPDIR:-/tmp}/tmux-$EUID-cpu"
67+
local tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
68+
if [ ! -d "$tmpdir" ]; then
69+
local tmpdir=~/tmp
70+
mkdir -p $tmpdir
71+
fi
72+
echo "$tmpdir/tmux-$EUID-cpu"
6873
}
6974

7075
get_time() {

0 commit comments

Comments
 (0)
Please sign in to comment.