Error handling for git prompt

This commit is contained in:
42berlin 2023-04-11 22:20:13 +02:00
parent 4eb338bc82
commit 2c8ed2d6a2
1 changed files with 2 additions and 2 deletions

View File

@ -37,10 +37,10 @@ PATH="${PATH}:/nfs/homes/tischmid/.local/bin"
GIT_PROMPT="1"
if [ ! -f ~/git-prompt.sh ] && [ "${GIT_PROMPT}" = "1" ] ; then
curl --silent --location 'https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh' -o "/nfs/homes/tischmid/git-prompt.sh"
curl --silent --location 'https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh' -o "~/git-prompt.sh"
fi
if [ "${GIT_PROMPT}" = "1" ] ; then
if [ ! -f ~/git-prompt.sh ] && [ "${GIT_PROMPT}" = "1" ] ; then
. ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='\[\033[31m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[m\] \[\033[33m\][\w]\[\033[m\]\[\033[36m\]$(__git_ps1 " (%s)")\[\033[m\]\n\[\033[35m\]~>\[\033[m\] '