handle powerline not existing

This commit is contained in:
Ivan Malison 2016-06-10 16:24:39 -07:00
parent 1315de4b37
commit 27f2baa4da
3 changed files with 9 additions and 6 deletions

View File

@ -78,5 +78,3 @@ esac
function set_powerline_prompt {
source "$(python_module_path powerline)/bindings/bash/powerline.sh"
}
set_powerline_prompt

View File

@ -421,3 +421,11 @@ function jump_cd {
function source_if_exists {
test -r "$1" && source "$1"
}
function python_module_exists {
python_module_path $@ 1>/dev/null 2>/dev/null
}
function set_default_prompt {
python_module_exists powerline && set_powerline_prompt || set_my_prompt
}

View File

@ -10,9 +10,6 @@ unalias run-help 2> /dev/null 1>/dev/null
autoload run-help
HELPDIR=/usr/local/share/zsh/helpfiles
function if_emacs_zsh {
if [ -z $(echo "$INSIDE_EMACS" | grep comint) ]; then
set_my_prompt
@ -21,4 +18,4 @@ function if_emacs_zsh {
fi
}
environment_variable_exists INSIDE_EMACS && if_emacs_zsh || set_powerline_prompt
environment_variable_exists INSIDE_EMACS && if_emacs_zsh || set_default_prompt