1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

pull upstream changes from gitstatus

This commit is contained in:
romkatv 2020-03-05 15:18:37 +01:00
parent a8cdc46a15
commit c8c74ec29f

View File

@ -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