Added environment variable GIT_PROMPT_STATUS_COMMAND that can point out a custom gitstatus.sh script if needed.

master
oGre 10 years ago
parent 47f4aca1f8
commit 09c98facb6
  1. 5
      gitprompt.sh
  2. 0
      gitstatus_pre-1.7.10.sh
  3. 3
      themes/Default.bgptheme

@ -282,8 +282,8 @@ function git_prompt_config() {
fi
if [[ -z "$__GIT_STATUS_CMD" ]] ; then # if GIT_STATUS_CMD not defined..
git_prompt_dir
if ! gp_maybe_set_envar_to_path __GIT_STATUS_CMD "$__GIT_PROMPT_DIR/gitstatus.sh" ; then
echo 1>&2 "Cannot find gitstatus.sh!"
if ! gp_maybe_set_envar_to_path __GIT_STATUS_CMD "$__GIT_PROMPT_DIR/$GIT_PROMPT_STATUS_COMMAND" ; then
echo 1>&2 "Cannot find $GIT_PROMPT_STATUS_COMMAND!"
fi
# __GIT_STATUS_CMD defined
fi
@ -520,7 +520,6 @@ function gp_add_virtualenv_to_prompt {
function is_function {
declare -Ff "$1" >/dev/null;
}
#Helper function that truncates $PWD depending on window width
function gp_truncate_pwd {
local newPWD="${PWD/#$HOME/~}"

@ -16,6 +16,7 @@ unset_git_prompt_colors() {
unset GIT_PROMPT_CLEAN
unset GIT_PROMPT_COMMAND_OK
unset GIT_PROMPT_COMMAND_FAIL
unset GIT_PROMPT_STATUS_COMMAND
unset GIT_PROMPT_VIRTUALENV
unset GIT_PROMPT_START_USER
unset GIT_PROMPT_START_ROOT
@ -60,6 +61,8 @@ define_undefined_git_prompt_colors() {
if [[ -z ${GIT_PROMPT_COMMAND_OK} ]]; then GIT_PROMPT_COMMAND_OK="${Green}✔"; fi # indicator if the last command returned with an exit code of 0
if [[ -z ${GIT_PROMPT_COMMAND_FAIL} ]]; then GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_"; fi # indicator if the last command returned with an exit code of other than 0
if [[ -z ${GIT_PROMPT_STATUS_COMMAND} ]]; then GIT_PROMPT_STATUS_COMMAND="gitstatus.sh"; fi # Point out the command to get the gitstatus from
# template for displaying the current virtual environment
# use the placeholder _VIRTUALENV_ will be replaced with
# the name of the current virtual environment (currently CONDA and VIRTUAL_ENV)

Loading…
Cancel
Save