adding env switch to turn hg on/off

This commit is contained in:
Viktor (Icon) VAD
2015-11-12 10:40:22 +00:00
parent 765b735de4
commit 5cbe050452
2 changed files with 15 additions and 1 deletions

View File

@@ -207,6 +207,11 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|`BULLETTRAIN_GIT_BEHIND`|`" ⬇"`|Icon for behind state from remote
|`BULLETTRAIN_GIT_DIVERGED`|`" ⬍"`|Icon for diverged state from remote
### Mercurial/HG
|Variable|Default|Meaning
|--------|-------|-------|
|`BULLETTRAIN_HG_SHOW`|`true`|Show/hide that segment
## Contributors

View File

@@ -144,6 +144,11 @@ if [ ! -n "${BULLETTRAIN_GIT_EXTENDED+1}" ]; then
BULLETTRAIN_GIT_EXTENDED=true
fi
# HG
if [ ! -n "${BULLETTRAIN_HG_SHOW+1}" ]; then
BULLETTRAIN_HG_SHOW=true
fi
# CONTEXT
if [ ! -n "${BULLETTRAIN_CONTEXT_SHOW+1}" ]; then
BULLETTRAIN_CONTEXT_SHOW=false
@@ -296,6 +301,10 @@ prompt_git() {
}
prompt_hg() {
if [[ $BULLETTRAIN_HG_SHOW == false ]]; then
return
fi
local rev status
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
@@ -497,7 +506,7 @@ build_prompt() {
prompt_nvm
prompt_go
prompt_git
# prompt_hg
prompt_hg
prompt_end
}