From fcf42705bdab200d0927cc84d51cecadd87d96b2 Mon Sep 17 00:00:00 2001 From: Rossi Guiliani Date: Fri, 26 Sep 2014 12:37:22 -0600 Subject: [PATCH] use original PS1 for all cases --- base.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/base.sh b/base.sh index 2d14247..bec88f7 100644 --- a/base.sh +++ b/base.sh @@ -17,12 +17,16 @@ function build_prompt { echo "${PSORG}" exit; fi - - PS1="" + PS1="" # Git info current_commit_hash=$(git rev-parse HEAD 2> /dev/null) if [[ -n $current_commit_hash ]]; then is_a_git_repo=true; else is_a_git_repo=false; fi - + + if [[ $is_a_git_repo == false ]]; then + echo "${PSORG}" + exit + fi + if [[ $is_a_git_repo == true ]]; then current_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null) if [[ $current_branch == 'HEAD' ]]; then detached=true; else detached=false; fi @@ -142,6 +146,5 @@ function build_prompt { else break='' fi - - echo "${PS1}${reset}${break}${finally}" + echo "${PS1}${PSORG}" }