Created
August 22, 2022 20:24
-
-
Save emersonmello/27a2b007c9fda38cf03f92da926e923e to your computer and use it in GitHub Desktop.
Personalizações do .bashrc
This file contains 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
# Alterando o prompt (variável PS1) para refletir o status do repositório git | |
# Adaptações de soluções presentes em https://gist.github.com/justintv/168835 | |
function situacao_repo_git() { | |
if [[ $(git status -s 2> /dev/null) ]]; then | |
echo -ne "\e[0;33m$(__git_ps1)\033[0m"; | |
else | |
echo -ne "\e[0;32m$(__git_ps1)\033[0m"; | |
fi | |
} | |
export PS1='\u@\[\e[1;31m\]\h \w\[\e[0m\]$(situacao_repo_git)\e[0m\] \$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment