From: manojlds Date: Thu, 14 Feb 2013 05:08:12 +0000 (+0530) Subject: Using $VIRTUAL_ENV to set virtualenv prompt X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=f93feb6e016195306113ce56f7cde7604aa5900f;p=common%2Fbash_it.git Using $VIRTUAL_ENV to set virtualenv prompt --- diff --git a/themes/base.theme.bash b/themes/base.theme.bash index f096fda..18c6c9d 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -137,8 +137,8 @@ function ruby_version_prompt { } function virtualenv_prompt { - if which virtualenv &> /dev/null; then - virtualenv=$([ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`") || return + if [[ -n "$VIRTUAL_ENV" ]]; then + virtualenv=`basename "$VIRTUAL_ENV"` echo -e "$VIRTUALENV_THEME_PROMPT_PREFIX$virtualenv$VIRTUALENV_THEME_PROMPT_SUFFIX" fi }