Skip to content

Instantly share code, notes, and snippets.

@macinnir
Last active August 29, 2015 14:20
Show Gist options
  • Save macinnir/a589a6bed27ecb4b6c2e to your computer and use it in GitHub Desktop.
Save macinnir/a589a6bed27ecb4b6c2e to your computer and use it in GitHub Desktop.
Bash Profile
#!/bin/bash
# System-wide .profile for sh(1)
# A portion taken from http://vvv.tobiassjosten.net/git/add-current-git-branch-to-your-bash-prompt/
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset=`tput sgr0`
c_user=`tput setaf 2; tput bold`
c_path=`tput setaf 4; tput bold`
c_git_clean=`tput setaf 2`
c_git_dirty=`tput setaf 1`
else
c_reset=
c_user=
c_path=
c_git_cleanclean=
c_git_dirty=
fi
git_prompt ()
{
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2; then
git_color="${c_git_clean}"
else
git_color=${c_git_cleanit_dirty}
fi
echo " [$git_color$git_branch${c_reset}]"
}
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
PATH=$PATH:/usr/local/mysql/bin
export CSDATABAK=/Library/WebServer/backups/
alias wine=/Applications/Wine.app/Contents/Resources/bin/wine
export DYLD_FALLBACK_LIBRARY_PATH=/usr/X11/lib:/usr/lib::
# export PS1='$(whoami):$(pwd):'
export PS1='${c_user}\u${c_reset}@${c_user}\h${c_reset}:${c_path}\w${c_reset}$(git_prompt)\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment