Merge pull request #56 from erikpukinskis/master

Move last little bit of script into a function so local is available
master
Martin Gondermann 12 years ago
commit 2838579462
  1. 24
      gitprompt.sh

@ -277,19 +277,20 @@ function prompt_callback_default {
return
}
if [ "`type -t prompt_callback`" = 'function' ]; then
function run {
if [ "`type -t prompt_callback`" = 'function' ]; then
prompt_callback="prompt_callback"
else
else
prompt_callback="prompt_callback_default"
fi
fi
if [ -z "$OLD_GITPROMPT" ]; then
if [ -z "$OLD_GITPROMPT" ]; then
OLD_GITPROMPT=$PS1
fi
fi
if [ -z "$PROMPT_COMMAND" ]; then
if [ -z "$PROMPT_COMMAND" ]; then
PROMPT_COMMAND=setGitPrompt
else
else
PROMPT_COMMAND=${PROMPT_COMMAND%% }; # remove trailing spaces
PROMPT_COMMAND=${PROMPT_COMMAND%\;}; # remove trailing semi-colon
@ -303,7 +304,10 @@ else
# echo "PROMPT_COMMAND does not contain: $new_entry"
;;
esac
fi
fi
git_prompt_dir
source "$__GIT_PROMPT_DIR/git-prompt-help.sh"
}
git_prompt_dir
source "$__GIT_PROMPT_DIR/git-prompt-help.sh"
run
Loading…
Cancel
Save