Fixes #5: Bash PS1 variable issues, thanks to jrgoldfinemiddleton.

This commit is contained in:
Jeff Geerling
2019-02-28 17:03:52 -06:00
parent c2e22fbab8
commit bf066e99c7
+17 -7
View File
@@ -6,7 +6,7 @@
# #
# Nicer prompt. # 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. # Use colors.
export CLICOLOR=1 export CLICOLOR=1
@@ -138,16 +138,26 @@ shopt -s extdebug
trap prod_command_trap DEBUG trap prod_command_trap DEBUG
function blt() { function blt() {
if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then if [[ ! -z ${AH_SITE_ENVIRONMENT} ]]; then
GIT_ROOT=$(git rev-parse --show-cdup) 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 else
GIT_ROOT="." PROJECT_ROOT="."
fi fi
if [ -f "$GIT_ROOT/vendor/bin/blt" ]; then if [ -f "$PROJECT_ROOT/vendor/bin/blt" ]; then
$GIT_ROOT/vendor/bin/blt "$@" $PROJECT_ROOT/vendor/bin/blt "$@"
# Check for local BLT.
elif [ -f "./vendor/bin/blt" ]; then
./vendor/bin/blt "$@"
else 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 return 1
fi fi
} }
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*