From 31f690f65cef62ac6be960c3b6c32337a218bad0 Mon Sep 17 00:00:00 2001 From: oGre Date: Thu, 10 Sep 2015 21:59:29 +0200 Subject: [PATCH] Check if prompt_callback is a function must occur after theme has loaded if theme is to override prompt_callback --- gitprompt.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gitprompt.sh b/gitprompt.sh index 323fcfc..6056eb5 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -225,6 +225,12 @@ function git_prompt_config() git_prompt_load_theme + if [ "`type -t prompt_callback`" = 'function' ]; then + prompt_callback="prompt_callback" + else + prompt_callback="prompt_callback_default" + fi + if [ $GIT_PROMPT_LAST_COMMAND_STATE = 0 ]; then LAST_COMMAND_INDICATOR="$GIT_PROMPT_COMMAND_OK"; else @@ -523,12 +529,6 @@ function prompt_callback_default { } function gp_install_prompt { - if [ "`type -t prompt_callback`" = 'function' ]; then - prompt_callback="prompt_callback" - else - prompt_callback="prompt_callback_default" - fi - if [ -z "$OLD_GITPROMPT" ]; then OLD_GITPROMPT=$PS1 fi