Allow to not have ~/.git-prompt.sh
This commit is contained in:
parent
0ca50e817a
commit
1f9ddefea2
15
bashrc
15
bashrc
|
@ -108,8 +108,14 @@ fi
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
||||||
|
|
||||||
[ "$TERM" != 'linux' -a z"$TERM" != z'eterm-color' ] && TITLE="\[\033]0;\u@\H:\w\a\]" || TITLE=''
|
[ "$TERM" != 'linux' -a z"$TERM" != z'eterm-color' ] && TITLE="\[\033]0;\u@\H:\w\a\]" || TITLE=''
|
||||||
export PS1="$TITLE\[$USERNAME_COLOR\]\u\[$WHITE\]@\[$HOSTNAME_COLOR\]\H\[$WHITE\]"''
|
export PS1="$TITLE\[$USERNAME_COLOR\]\u\[$WHITE\]@\[$HOSTNAME_COLOR\]\H\[$WHITE\]"
|
||||||
export PROMPT_COMMAND='__git_ps1 "'"$PS1"'" "\\\$ "'
|
# .git-prompt.sh is here: https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
|
||||||
|
if [ -f ~/.git-prompt.sh ]
|
||||||
|
then
|
||||||
|
export PROMPT_COMMAND='__git_ps1 "'"$PS1"'" "\\\$ "'
|
||||||
|
else
|
||||||
|
export PS1="$PS1"'\$ '
|
||||||
|
fi
|
||||||
|
|
||||||
alias grep="grep --color"
|
alias grep="grep --color"
|
||||||
alias ls='ls $LS_OPTIONS'
|
alias ls='ls $LS_OPTIONS'
|
||||||
|
@ -233,4 +239,7 @@ function marks
|
||||||
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
|
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
|
||||||
}
|
}
|
||||||
|
|
||||||
source ~/.git-prompt.sh
|
if [ -f ~/.git-prompt.sh ]
|
||||||
|
then
|
||||||
|
source ~/.git-prompt.sh
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue