diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-07-14 07:46:05 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-07-14 07:46:05 +0300 |
commit | 4635fcaceec0f16bbeba9da8e3512fbedf709b8e (patch) | |
tree | 48b9b95dcba55e9a8735161ba9b4bad2cfa09a70 /internal/p10k.zsh | |
parent | a28d45005ea6c48f013c9feed888b6b9e159dc2f (diff) |
don't fetch gitstatusd if there is no git
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r-- | internal/p10k.zsh | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 94c5532c..52d85d5e 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -6412,18 +6412,22 @@ _p9k_precmd_impl() { ret=$? fi if (( ret == 0 )); then - ( - local -i pid - { - { /bin/sh "$__p9k_root_dir"/gitstatus/install </dev/null &>/dev/null & } && pid=$! - ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) - } always { - if (( pid )); then - kill -- $pid 2>/dev/null - wait -- $pid 2>/dev/null - fi - } - ) + if (( $+commands[git] )); then + ( + local -i pid + { + { /bin/sh "$__p9k_root_dir"/gitstatus/install </dev/null &>/dev/null & } && pid=$! + ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) + } always { + if (( pid )); then + kill -- $pid 2>/dev/null + wait -- $pid 2>/dev/null + fi + } + ) + else + ( builtin source "$__p9k_root_dir"/internal/wizard.zsh ) + fi if (( $? )); then instant_prompt_disabled=1 else |