]> code.delx.au - dotfiles/commitdiff
bash: look for git-prompt.sh in more places
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 21 Dec 2018 13:26:04 +0000 (00:26 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 21 Dec 2018 13:37:37 +0000 (00:37 +1100)
.bashrc

diff --git a/.bashrc b/.bashrc
index e8502b283bddc6dbfff50d082abe01fd840734b3..dd3cfa296728b509c3c8985b952ae87be5499985 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -93,8 +93,13 @@ function find_up_exists {
     return 1
 }
 
-[ -r /usr/lib/git-core/git-sh-prompt ] && source /usr/lib/git-core/git-sh-prompt
-[ -r /usr/share/git/completion/git-prompt.sh ] && source /usr/share/git/completion/git-prompt.sh
+for p in /usr/lib/git-core/git-sh-prompt \
+         /usr/share/git/completion/git-prompt.sh \
+         /usr/local/share/git-core/contrib/completion/git-prompt.sh
+do
+    [ -r "$p" ] && source "$p" && break
+done
+
 function my_git_ps1 {
     find_up_exists .git || return
     GIT_PS1_SHOWDIRTYSTATE=1 \