From 55d9d015ff0b93be866ee7aa3c67c1b3d66fe67b Mon Sep 17 00:00:00 2001 From: TheK4n Date: Thu, 23 Sep 2021 01:57:50 +0300 Subject: [PATCH] ref --- .bash_aliases | 2 +- .bashrc | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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