mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
Merge commit 'a3c1b7164be115f097682088c6feac283c40a1f2'
This commit is contained in:
commit
00cf3b1167
2 changed files with 10 additions and 10 deletions
|
@ -76,7 +76,7 @@ function gitstatus_start() {
|
||||||
[[ -n "$log_level" || "${GITSTATUS_ENABLE_LOGGING:-0}" != 1 ]] || log_level=INFO
|
[[ -n "$log_level" || "${GITSTATUS_ENABLE_LOGGING:-0}" != 1 ]] || log_level=INFO
|
||||||
|
|
||||||
local uname_sm
|
local uname_sm
|
||||||
uname_sm="$(uname -sm)" || return
|
uname_sm="$(command uname -sm)" || return
|
||||||
uname_sm="${uname_sm,,}"
|
uname_sm="${uname_sm,,}"
|
||||||
local uname_s="${uname_sm% *}"
|
local uname_s="${uname_sm% *}"
|
||||||
local uname_m="${uname_sm#* }"
|
local uname_m="${uname_sm#* }"
|
||||||
|
@ -86,8 +86,8 @@ function gitstatus_start() {
|
||||||
else
|
else
|
||||||
local cpus
|
local cpus
|
||||||
if ! command -v sysctl &>/dev/null || [[ "$uname_s" == linux ]] ||
|
if ! command -v sysctl &>/dev/null || [[ "$uname_s" == linux ]] ||
|
||||||
! cpus="$(sysctl -n hw.ncpu)"; then
|
! cpus="$(command sysctl -n hw.ncpu)"; then
|
||||||
if ! command -v getconf &>/dev/null || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then
|
if ! command -v getconf &>/dev/null || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then
|
||||||
cpus=8
|
cpus=8
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -104,7 +104,7 @@ function gitstatus_start() {
|
||||||
--dirty-max-index-size="$max_dirty"
|
--dirty-max-index-size="$max_dirty"
|
||||||
$extra_flags)
|
$extra_flags)
|
||||||
|
|
||||||
tmpdir="$(mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return
|
tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return
|
||||||
|
|
||||||
if [[ -n "$log_level" ]]; then
|
if [[ -n "$log_level" ]]; then
|
||||||
GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log
|
GITSTATUS_DAEMON_LOG="$tmpdir"/daemon.log
|
||||||
|
@ -115,7 +115,7 @@ function gitstatus_start() {
|
||||||
|
|
||||||
req_fifo="$tmpdir"/req.fifo
|
req_fifo="$tmpdir"/req.fifo
|
||||||
resp_fifo="$tmpdir"/resp.fifo
|
resp_fifo="$tmpdir"/resp.fifo
|
||||||
mkfifo -- "$req_fifo" "$resp_fifo" || return
|
command mkfifo -- "$req_fifo" "$resp_fifo" || return
|
||||||
|
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
|
|
|
@ -365,7 +365,7 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
trap '' PIPE
|
trap '' PIPE
|
||||||
|
|
||||||
local uname_sm
|
local uname_sm
|
||||||
uname_sm="${(L)$(uname -sm)}" || return
|
uname_sm="${(L)$(command uname -sm)}" || return
|
||||||
[[ $uname_sm == [^' ']##' '[^' ']## ]] || return
|
[[ $uname_sm == [^' ']##' '[^' ']## ]] || return
|
||||||
local uname_s=${uname_sm% *}
|
local uname_s=${uname_sm% *}
|
||||||
local uname_m=${uname_sm#* }
|
local uname_m=${uname_sm#* }
|
||||||
|
@ -375,15 +375,15 @@ function _gitstatus_daemon"${1:-}"() {
|
||||||
else
|
else
|
||||||
local cpus
|
local cpus
|
||||||
if (( ! $+commands[sysctl] )) || [[ $uname_s == linux ]] ||
|
if (( ! $+commands[sysctl] )) || [[ $uname_s == linux ]] ||
|
||||||
! cpus="$(sysctl -n hw.ncpu)"; then
|
! cpus="$(command sysctl -n hw.ncpu)"; then
|
||||||
if (( ! $+commands[getconf] )) || ! cpus="$(getconf _NPROCESSORS_ONLN)"; then
|
if (( ! $+commands[getconf] )) || ! cpus="$(command getconf _NPROCESSORS_ONLN)"; then
|
||||||
cpus=8
|
cpus=8
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16)))
|
args+=(-t $((cpus > 16 ? 32 : cpus > 0 ? 2 * cpus : 16)))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkfifo -- $file_prefix.fifo || return
|
command mkfifo -- $file_prefix.fifo || return
|
||||||
print -rnu $pipe_fd -- ${(l:20:)pgid} || return
|
print -rnu $pipe_fd -- ${(l:20:)pgid} || return
|
||||||
exec <$file_prefix.fifo || return
|
exec <$file_prefix.fifo || return
|
||||||
zf_rm -- $file_prefix.fifo || return
|
zf_rm -- $file_prefix.fifo || return
|
||||||
|
@ -752,7 +752,7 @@ function gitstatus_start"${1:-}"() {
|
||||||
print -ru2 -- ' System information:'
|
print -ru2 -- ' System information:'
|
||||||
print -Pru2 -- '%F{yellow}'
|
print -Pru2 -- '%F{yellow}'
|
||||||
print -ru2 -- " zsh: $ZSH_VERSION"
|
print -ru2 -- " zsh: $ZSH_VERSION"
|
||||||
print -ru2 -- " uname -a: $(uname -a)"
|
print -ru2 -- " uname -a: $(command uname -a)"
|
||||||
print -Pru2 -- '%f'
|
print -Pru2 -- '%f'
|
||||||
print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:'
|
print -ru2 -- ' If you need help, open an issue and attach this whole error message to it:'
|
||||||
print -ru2 -- ''
|
print -ru2 -- ''
|
||||||
|
|
Loading…
Reference in a new issue