Added a flag within the base theme to turn version control checks completely off or on.

pull/345/head
Carlos E. Reynosa-Nunez 2014-10-04 17:13:23 -07:00
parent 4d2a8fe62b
commit 34e9525f1a
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
THEME_PROMPT_HOST='\H' THEME_PROMPT_HOST='\H'
SCM_CHECK=${SCM_CHECK:=true}
SCM_THEME_PROMPT_DIRTY=' ✗' SCM_THEME_PROMPT_DIRTY=' ✗'
SCM_THEME_PROMPT_CLEAN=' ✓' SCM_THEME_PROMPT_CLEAN=' ✓'
SCM_THEME_PROMPT_PREFIX=' |' SCM_THEME_PROMPT_PREFIX=' |'
@ -31,7 +34,9 @@ RBFU_THEME_PROMPT_PREFIX=' |'
RBFU_THEME_PROMPT_SUFFIX='|' RBFU_THEME_PROMPT_SUFFIX='|'
function scm { function scm {
if [[ -f .git/HEAD ]]; then SCM=$SCM_GIT
if [[ "$SCM_CHECK" = false ]]; then SCM=$SCM_NONE
elif [[ -f .git/HEAD ]]; then SCM=$SCM_GIT
elif which git &> /dev/null && [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT elif which git &> /dev/null && [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT
elif [[ -d .hg ]]; then SCM=$SCM_HG elif [[ -d .hg ]]; then SCM=$SCM_HG
elif which hg &> /dev/null && [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG elif which hg &> /dev/null && [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG