Skip to content

Instantly share code, notes, and snippets.

@hurshagrawal
Created January 19, 2012 22:47
Show Gist options
  • Save hurshagrawal/1643472 to your computer and use it in GitHub Desktop.
Save hurshagrawal/1643472 to your computer and use it in GitHub Desktop.
Show git branch in bash
# Show branch in status line
PS1='[\W$(__git_ps1 " (%s)")]\$ '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
@hurshagrawal
Copy link
Author

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

export PATH=/usr/local/bin:$PATH

for a in local $(ls /opt/ | grep -v local | grep -v gentoo); do
  FULLPATH=/opt/$a
  if [ -x $FULLPATH ]; then
    if [ -x $FULLPATH/bin ]; then
      export PATH="$FULLPATH/bin:$PATH"
    fi
    if [ -x $FULLPATH/sbin ]; then
      export PATH="$FULLPATH/sbin:$PATH"
    fi
    if [ -x $FULLPATH/share/aclocal ]; then
      export ACLOCAL_FLAGS="-I $FULLPATH/share/aclocal $ACLOCAL_FLAGS"
    fi
    if [ -x $FULLPATH/man ]; then
      export MANPATH="$FULLPATH/man:$MANPATH"
    fi
    if [ -x $FULLPATH/share/man ]; then
      export MANPATH="$FULLPATH/share/man:$MANPATH"
    fi
    if [ -x $FULLPATH/lib/pkgconfig ]; then
      export PKG_CONFIG_PATH="$FULLPATH/lib/pkgconfig/:$PKG_CONFIG_PATH"
    fi
  fi
done

##
# Your previous /Users/Hursh/.bash_profile file was backed up as /Users/Hursh/.bash_profile.macports-saved_2011-02-11_at_14:55:00
##

# MacPorts Installer addition on 2011-02-11_at_14:55:00: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

# export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

export PATH=$PATH\:/usr/local/mysql/bin/

# Java/Clojure stuff
export CLASSPATH=$CLASSPATH:/usr/local/Cellar/clojure-contrib/1.2.0/clojure-contrib.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment