summaryrefslogtreecommitdiff
path: root/gitstatus.plugin.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-01-26 16:45:50 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-01-26 16:45:50 +0300
commit5014de0541201716dc4ee6f544321ac4e3d7431e (patch)
tree9bcb02b18cd6292560921e51d31e3bb3fd21ba6b /gitstatus.plugin.zsh
parentc8160f29543a2f57ae7149103deefa029fd4e861 (diff)
Squashed 'gitstatus/' changes from e02d9eed..6eb490ab
6eb490ab survive broken $TMPDIR 94bf4fc2 add ppc64 support to the build script git-subtree-dir: gitstatus git-subtree-split: 6eb490ab86118ad063224e4d50b6b05bea7dd12c
Diffstat (limited to 'gitstatus.plugin.zsh')
-rw-r--r--gitstatus.plugin.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh
index 181e756a..228fea74 100644
--- a/gitstatus.plugin.zsh
+++ b/gitstatus.plugin.zsh
@@ -574,7 +574,12 @@ function gitstatus_start"${1:-}"() {
else
typeset -gi _GITSTATUS_START_COUNTER
local log_level=$GITSTATUS_LOG_LEVEL
- local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID
+ if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
+ local tmpdir=$TMPDIR
+ else
+ local tmpdir=/tmp
+ fi
+ local file_prefix=${tmpdir:A}/gitstatus.$name.$EUID
file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER))
(( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO}
if [[ -n $log_level ]]; then