From bf066e99c786d89571f779591969c93445e6f463 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 28 Feb 2019 17:03:52 -0600 Subject: [PATCH] Fixes #5: Bash PS1 variable issues, thanks to jrgoldfinemiddleton. --- .bash_profile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.bash_profile b/.bash_profile index ceea725..6222d38 100644 --- a/.bash_profile +++ b/.bash_profile @@ -6,7 +6,7 @@ # # Nicer prompt. -export PS1="\[\e[0;32m\]\]\[\] \[\e[1;32m\]\]\t \[\e[0;2m\]\]\w \[\e[0m\]\]\[$\] " +export PS1="\[\e[0;32m\] \[\e[1;32m\]\t \[\e[0;2m\]\w \[\e[0m\]\$ " # Use colors. export CLICOLOR=1 @@ -138,16 +138,26 @@ shopt -s extdebug trap prod_command_trap DEBUG function blt() { - if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then - GIT_ROOT=$(git rev-parse --show-cdup) + if [[ ! -z ${AH_SITE_ENVIRONMENT} ]]; then + PROJECT_ROOT="/var/www/html/${AH_SITE_GROUP}.${AH_SITE_ENVIRONMENT}" + elif [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then + PROJECT_ROOT=$(git rev-parse --show-cdup) else - GIT_ROOT="." + PROJECT_ROOT="." fi - if [ -f "$GIT_ROOT/vendor/bin/blt" ]; then - $GIT_ROOT/vendor/bin/blt "$@" + if [ -f "$PROJECT_ROOT/vendor/bin/blt" ]; then + $PROJECT_ROOT/vendor/bin/blt "$@" + + # Check for local BLT. + elif [ -f "./vendor/bin/blt" ]; then + ./vendor/bin/blt "$@" + else - echo "You must run this command from within a BLT-generated project repository." + echo "You must run this command from within a BLT-generated project." return 1 fi } + + +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*