Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rbenv prompt, Git shell extensions on Mountain Lion

  • Loading branch information...
commit e9ecdf1d96f4226b2adc911ab7fea61b772dac3a 1 parent 3a55136
@liff authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 dot.bashrc.sh
View
10 dot.bashrc.sh
@@ -73,6 +73,14 @@ if [[ -n "$PS1" ]]; then
[ -f /etc/bash_completion ] && ! shopt -oq posix && . /etc/bash_completion
exists brew && [ -f `brew --prefix`/etc/bash_completion ] && . `brew --prefix`/etc/bash_completion
+ ## Git prompt and completion
+ if exists brew && [ -f `brew --prefix git`/share/git-core/git-prompt.sh ]; then
+ . `brew --prefix git`/share/git-core/git-prompt.sh
+ elif [ -f /usr/share/git-core/git-prompt.sh ]; then
+ . /usr/share/git-core/git-prompt.sh
+ [ -f /usr/share/git-core/git-completion.bash ] && . /usr/share/git-core/git-completion.bash
+ fi
+
## set prompt
if ! type __git_ps1 &>/dev/null; then
__git_ps1() {
@@ -107,6 +115,8 @@ if [[ -n "$PS1" ]]; then
[[ -n "$(rvm-prompt)" ]] && echo " "
}
PS1="\[\e[1;34m\]\$(rvm-prompt i)\[\e[0;34m\]\$(rvm-prompt v)\[\e[0;31m\]\$(rvm-prompt g)\$(rvm_prompt_space)$PS1"
+ elif exists rbenv; then
+ PS1="\[\e[0;34m\]\$(rbenv version-name) $PS1"
fi
## clean up
Please sign in to comment.
Something went wrong with that request. Please try again.