aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitstatus/gitstatus.plugin.zsh34
1 files changed, 23 insertions, 11 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 59d5805b..8cfa008e 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -442,7 +442,7 @@ function gitstatus_start() {
file_prefix=${(P)${:-_GITSTATUS_FILE_PREFIX_$name}}
else
local log_level=$GITSTATUS_LOG_LEVEL
- local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$EUID.$sysparams[pid].$EPOCHSECONDS
+ local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID.$sysparams[pid].$EPOCHSECONDS
(( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO}
if [[ -n $log_level ]]; then
xtrace=$file_prefix.xtrace.log
@@ -501,25 +501,37 @@ function gitstatus_start() {
elif [[ -n $GITSTATUS_DAEMON ]]; then
local daemons=($_gitstatus_plugin_dir/{usrbin,bin}/$GITSTATUS_DAEMON)
else
- local os
+ local -aU os
case $kernel in
linux)
- os="${(L)$(uname -o)}" || return
- [[ -n $os ]] || return
- [[ $os == android ]] || os=linux
+ os=("${(L)$(uname -o)}") || return
+ [[ -n $os[1] ]] || return
+ [[ $os[1] == android ]] || os[1]=linux
;;
- cygwin_nt-*) os=cygwin_nt-10.0;;
- mingw|msys) os=msys_nt-10.0;;
- *) os=$kernel;;
+ cygwin_nt-*) os=($kernel cygwin_nt-10.0);;
+ mingw|msys) os=($kernel msys_nt-10.0);;
+ *) os=($kernel);;
esac
local arch
arch="${(L)$(uname -m)}" || return
[[ -n $arch ]] || return
- local daemons=($_gitstatus_plugin_dir/{usrbin,bin}/gitstatusd-$os-$arch{,-static})
+ local daemons=(
+ $_gitstatus_plugin_dir/{usrbin,bin}/gitstatusd-${^os}-$arch{,-static})
+ fi
+
+ local files=(${^daemons}(N:A))
+ daemons=(${^files}(N*))
+
+ if (( stderr_fd && $#daemons != $#files )); then
+ unsetopt xtrace
+ print -ru2 -- ''
+ print -ru2 -- 'ERROR: missing execute permissions on gitstatusd file(s):'
+ print -ru2 -- ''
+ print -ru2 -- ' '${(pj:\n :)${files:|daemons}}
+ print -ru2 -- ''
+ setopt xtrace
fi
- daemons=(${^daemons}(N:A))
- daemons=(${^daemons}(N*))
(( $#daemons )) || return
if [[ $GITSTATUS_NUM_THREADS == <1-> ]]; then