aks: changed all file envars to end with _FILE; added git_prompt_reset

master
Alan Stebbens 11 years ago
parent df7894135a
commit f82446c9ac
  1. 18
      gitprompt.sh

@ -67,6 +67,18 @@ function gp_maybe_set_envar_to_path(){
return 1 return 1
} }
# git_prompt_reset
#
# unsets selected GIT_PROMPT variables, causing the next prompt callback to
# recalculate them from scratch.
git_prompt_reset() {
local var
for var in GIT_PROMPT_DIR __GIT_PROMPT_COLORS_FILE __PROMPT_COLORS_FILE __GIT_STATUS_CMD ; do
unset $var
done
}
function git_prompt_config() function git_prompt_config()
{ {
#Checking if root to change output #Checking if root to change output
@ -78,8 +90,8 @@ function git_prompt_config()
# prompt-colors.sh -- sets generic color names suitable for bash `PS1` prompt # prompt-colors.sh -- sets generic color names suitable for bash `PS1` prompt
# git-prompt-colors.sh -- sets the GIT_PROMPT color scheme, using names from prompt-colors.sh # git-prompt-colors.sh -- sets the GIT_PROMPT color scheme, using names from prompt-colors.sh
if gp_set_file_var __PROMPT_COLORS_SH prompt-colors.sh ; then if gp_set_file_var __PROMPT_COLORS_FILE prompt-colors.sh ; then
source "$__PROMPT_COLORS_SH" # outsource the color defs source "$__PROMPT_COLORS_FILE" # outsource the color defs
else else
echo 1>&2 "Cannot find prompt-colors.sh!" echo 1>&2 "Cannot find prompt-colors.sh!"
fi fi
@ -220,8 +232,6 @@ function updatePrompt() {
local PROMPT_START local PROMPT_START
local PROMPT_END local PROMPT_END
local EMPTY_PROMPT local EMPTY_PROMPT
local GIT_PROMPT_FETCH_TIMEOUT
local __GIT_STATUS_CMD
local Blue="\[\033[0;34m\]" local Blue="\[\033[0;34m\]"
git_prompt_config git_prompt_config

Loading…
Cancel
Save