diff --git a/.bash_aliases b/.bash_aliases index ab0c949..7e6dcfa 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,6 +1,6 @@ # colors -if [ -x /usr/bin/dircolors ]; then +if [ -x "$(which dircolors)" ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias dir='dir --color=auto' diff --git a/.bashrc b/.bashrc index 3f54431..e637e17 100644 --- a/.bashrc +++ b/.bashrc @@ -14,6 +14,12 @@ export HISTIGNORE="&:l[lsa]:[bf]g:exit:q:clear:c:history:h" parse_git_branch() { + + if ! [ -x "$(which git)" ]; then + echo '' + return + fi + branch="$(git branch --show-current 2> /dev/null)" if [[ -n "$branch" ]]; then @@ -25,6 +31,7 @@ parse_git_branch() { virtualenv_info() { + # Get Virtual Env if [[ -n "$VIRTUAL_ENV" ]]; then # Strip out the path and just leave the env name