Created
June 16, 2016 16:31
-
-
Save rmcvey/6da0ce4bf1a336934b4fdc6ee4e4f448 to your computer and use it in GitHub Desktop.
PS1 that displays git or svn status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scm_ps1() { | |
local s= | |
if [[ -d ".svn" ]] ; then | |
s=\(svn:$(svn info | sed -n -e '/^Revision: \([0-9]*\).*$/s//\1/p' )\) | |
else | |
s=$(__git_ps1 "(git:%s)") | |
fi | |
echo "$s" | |
} | |
export PS1="\[\033[00;32m\]\u\[\033[00;32m\]@\[\033[00;32m\]\h:\[\033[01;34m\]\w \[\033[31m\]\$(scm_ps1)\[\033[00m\]$\[\033[00m\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment