Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Determine if the current directory is a GIT repo
- # and print out '*' if there are changes to be committed
- iz_git_dirty() {
- #IZ_GIT=`git status 2>/dev/null`
- IZ_DIRTY=`git status 2>/dev/null | grep 'nothing to commit (working directory clean)'`
- #if [ "." != "$IZ_GIT." ]; then
- if [ "." == "$IZ_DIRTY." ]; then
- echo '*'
- fi
- #fi
- }
- # Determine if the current directory is a GIT repo
- # and print out the current branch name (and call iz_git_dirty)
- parse_git_branch() {
- BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
- if [ "." != "$BRANCH." ]; then
- echo "(${BRANCH}$(iz_git_dirty))"
- fi
- }
- # Put the above stuff into the prompt
- if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(parse_git_branch)\$ '
- else
- PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
- fi
Add Comment
Please, Sign In to add comment