summaryrefslogtreecommitdiff
path: root/gitstatus/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
commitcead0349c57f27521b8307b4651a5c077e6bb276 (patch)
tree17a2d5b69353c2768b135c2da5c69d6e90c6a7c7 /gitstatus/gitstatus.plugin.zsh
parent6c71862c5f9824dc92273fbe1d0dd0c37210f2af (diff)
parent5014de0541201716dc4ee6f544321ac4e3d7431e (diff)
Merge commit '5014de0541201716dc4ee6f544321ac4e3d7431e'
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-rw-r--r--gitstatus/gitstatus.plugin.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 181e756a..228fea74 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/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