From 4f312e890df956a858e1e7278cf1782b8f379d2c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 15 Jul 2010 11:14:28 -0400 Subject: Check for availability of git completion --- dotfiles/bashrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dotfiles/bashrc b/dotfiles/bashrc index d49c012..09add68 100644 --- a/dotfiles/bashrc +++ b/dotfiles/bashrc @@ -30,6 +30,11 @@ _format_uid () fi } -PS1='\W$(_format_uid)$(_format_inroot_dir)$(__git_ps1 " [git %s]") \$ ' +PS1_PREFIX='\W$(_format_uid)$(_format_inroot_dir)' +if test -n "$BASH_COMPLETION" && test -f /etc/bash_completion.d/git; then + PS1_PREFIX="$PS1_PREFIX"'$(__git_ps1 " [git %s]")' +fi + +PS1="$PS1_PREFIX"' \$ ' export PS1 -- cgit