Skip to content

Instantly share code, notes, and snippets.

@typelogic
Last active September 4, 2020 18:57
Show Gist options
  • Save typelogic/e14c76dbe07ce18b097b675a853661b8 to your computer and use it in GitHub Desktop.
Save typelogic/e14c76dbe07ce18b097b675a853661b8 to your computer and use it in GitHub Desktop.
my PS1
getjavaversion() {
java -version 2>&1 | awk 'NR==1{gsub("\"","");print $3}'
}
is_uoc() {
[ -r .data/.m2/settings.xml ] && printf M
}
git_branch() {
[ -d .git ] && git branch --show-current
}
export PS1='\e[44;1;37m$(pwd) \e[42;1;37m`getjavaversion`\[\e[0;35m\]|\e[1;37m`is_uoc`\[\e[0;35m\]|\e[45;1;37m`git_branch`\[\e[0m\]\n$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment