From 2c8ed2d6a25ff1220003f5794544ce2d0bac8cc4 Mon Sep 17 00:00:00 2001 From: 42berlin <42berlin@noreply.localhost> Date: Tue, 11 Apr 2023 22:20:13 +0200 Subject: [PATCH] Error handling for git prompt --- .bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index fdfdd92..db49758 100644 --- a/.bashrc +++ b/.bashrc @@ -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\] '