Merge remote-tracking branch 'origin/master' into vadviktor-patch-pyenv

This commit is contained in:
Viktor (Icon) VAD
2015-09-24 10:06:55 +01:00
parent 3bfb593250
commit fbbd93f8a3
3 changed files with 55 additions and 39 deletions

View File

@@ -1,3 +1,4 @@
sudo: false
language: node_js
node_js:
- 0.10

View File

@@ -13,7 +13,7 @@ simplicity, showing information only when it's relevant.
It currently shows:
- Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
- Current Ruby version using Rbenv; version and gemset when on RVM
- Current Ruby version using Rbenv or chruby; version and gemset when on RVM
- Current Node.js version, through NVM
- Git status
- Timestamp
@@ -106,6 +106,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|--------|-------|-------|
|`BULLETTRAIN_PROMPT_CHAR`|`\$`|Character to be show before any command
|`BULLETTRAIN_PROMPT_ROOT`|`true`|Highlight if running as root
|`BULLETTRAIN_PROMPT_SEPARATE_LINE`|`true`|Make the prompt span across two lines
### Status
@@ -205,28 +206,32 @@ most of the code was later erased and its now more closely related to
of the project:
```
82 Caio Gondim
100 Caio Gondim
33 Jérémy Romey
07 Jocelyn Mallon
06 Jérémy Romey
06 Dan Kaplun
05 Arthur Wang
04 Flavius Aspra
04 Joe Block
02 wujtruj
02 itsZero (Chien-An Cho)
01 m.kuehn
01 Adrien Brault
01 yachi
01 Guillaume BINET
01 Hannes Frank
01 Kevin
01 Mario Zigliotto
01 Marius Krämer
01 Michael Robinson
01 gvillalta99
01 illuminatis
01 krischer
7 Jocelyn Mallon
7 Greg Fitzgerald
6 Dan Kaplun
6 Jérémy Romey
6 Joe Block
5 Arthur Wang
4 Flavius Aspra
3 Viktor (Icon) VAD
3 Mario Zigliotto
2 wujtruj
2 itsZero (Chien-An Cho)
1 yachi
1 Andreas Galauner
1 Guillaume BINET
1 Hannes Frank
1 Kevin
1 Marius Krämer
1 Michael Robinson
1 Sébastien Bordenave
1 gvillalta99
1 illuminatis
1 krischer
1 m.kuehn
1 Adrien Brault
```
## Credits

View File

@@ -22,6 +22,9 @@ fi
if [ ! -n "${BULLETTRAIN_PROMPT_ROOT+1}" ]; then
BULLETTRAIN_PROMPT_ROOT=true
fi
if [ ! -n "${BULLETTRAIN_PROMPT_SEPARATE_LINE+1}" ]; then
BULLETTRAIN_PROMPT_SEPARATE_LINE=true
fi
# STATUS
if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then
@@ -257,7 +260,7 @@ prompt_context() {
# Git
prompt_git() {
if [[ $BULLETTRAIN_GIT_SHOW == false ]] then
if [[ $BULLETTRAIN_GIT_SHOW == false ]]; then
return
fi
@@ -267,7 +270,7 @@ prompt_git() {
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
prompt_segment $BULLETTRAIN_GIT_BG $BULLETTRAIN_GIT_FG
if [[ $BULLETTRAIN_GIT_EXTENDED == true ]] then
if [[ $BULLETTRAIN_GIT_EXTENDED == true ]]; then
echo -n $(git_prompt_info)$(git_prompt_status)
else
echo -n $(git_prompt_info)
@@ -312,7 +315,7 @@ prompt_hg() {
# Dir: current working directory
prompt_dir() {
if [[ $BULLETTRAIN_DIR_SHOW == false ]] then
if [[ $BULLETTRAIN_DIR_SHOW == false ]]; then
return
fi
@@ -337,24 +340,27 @@ prompt_dir() {
# RUBY
# RVM: only shows RUBY info if on a gemset that is not the default one
# RBENV: shows current ruby version active in the shell
# CHRUBY: shows current ruby version active in the shell
prompt_ruby() {
if [[ $BULLETTRAIN_RUBY_SHOW == false ]] then
if [[ $BULLETTRAIN_RUBY_SHOW == false ]]; then
return
fi
if which rvm-prompt &> /dev/null; then
if command -v rvm-prompt > /dev/null 2>&1; then
if [[ ! -n $(rvm gemset list | grep "=> (default)") ]]
then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
fi
elif which rbenv &> /dev/null; then
elif command -v chruby > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(chruby | sed -e 's/ \* //')"
elif command -v rbenv > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
fi
}
# Virtualenv: current working virtualenv
prompt_virtualenv() {
if [[ $BULLETTRAIN_VIRTUALENV_SHOW == false ]] then
if [[ $BULLETTRAIN_VIRTUALENV_SHOW == false ]]; then
return
fi
@@ -368,7 +374,7 @@ prompt_virtualenv() {
# NVM: Node version manager
prompt_nvm() {
if [[ $BULLETTRAIN_NVM_SHOW == false ]] then
if [[ $BULLETTRAIN_NVM_SHOW == false ]]; then
return
fi
@@ -382,11 +388,11 @@ prompt_nvm() {
}
prompt_time() {
if [[ $BULLETTRAIN_TIME_SHOW == false ]] then
if [[ $BULLETTRAIN_TIME_SHOW == false ]]; then
return
fi
if [[ $BULLETTRAIN_TIME_12HR == true ]] then
if [[ $BULLETTRAIN_TIME_12HR == true ]]; then
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}
else
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%X}
@@ -398,7 +404,7 @@ prompt_time() {
# - am I root
# - are there background jobs?
prompt_status() {
if [[ $BULLETTRAIN_STATUS_SHOW == false ]] then
if [[ $BULLETTRAIN_STATUS_SHOW == false ]]; then
return
fi
@@ -409,9 +415,9 @@ prompt_status() {
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡%f"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="⚙"
if [[ -n "$symbols" && $RETVAL -ne 0 ]] then
if [[ -n "$symbols" && $RETVAL -ne 0 ]]; then
prompt_segment $BULLETTRAIN_STATUS_ERROR_BG $BULLETTRAIN_STATUS_FG "$symbols"
elif [[ -n "$symbols" ]] then
elif [[ -n "$symbols" ]]; then
prompt_segment $BULLETTRAIN_STATUS_BG $BULLETTRAIN_STATUS_FG "$symbols"
fi
@@ -421,11 +427,11 @@ prompt_status() {
prompt_char() {
local bt_prompt_char
if [[ ${#BULLETTRAIN_PROMPT_CHAR} -eq 1 ]] then
if [[ ${#BULLETTRAIN_PROMPT_CHAR} -eq 1 ]]; then
bt_prompt_char="${BULLETTRAIN_PROMPT_CHAR}"
fi
if [[ $BULLETTRAIN_PROMPT_ROOT == true ]] then
if [[ $BULLETTRAIN_PROMPT_ROOT == true ]]; then
bt_prompt_char="%(!.%F{red}#.%F{green}${bt_prompt_char}%f)"
fi
@@ -451,6 +457,10 @@ build_prompt() {
prompt_end
}
if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] then
PROMPT='
%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
else
PROMPT='%{%f%b%k%}$(build_prompt)%{${fg_bold[default]}%} $(prompt_char) %{$reset_color%}'
fi