Merge pull request #181 from vadviktor/vadviktor-elixir-support

Let's add some (basic) Elixir support
This commit is contained in:
Viktor (Icon) VAD
2017-03-21 18:06:54 +00:00
committed by GitHub
2 changed files with 29 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ It currently shows:
- Current Ruby version using chruby; version and gemset when on RVM or Rbenv
- Current Node.js version, through NVM (if present) or Node.js
- Current Perl version using plenv
- Current Elixir version
- Git status
- Timestamp
- Current directory
@@ -170,6 +171,14 @@ NOTE: You do not need to specify *end* segment - it will be added automatically.
|`BULLETTRAIN_RUBY_FG`|`white`|Foreground color
|`BULLETTRAIN_RUBY_PREFIX`|`"♦"`|Prefix of the segment
### Elixir
|Variable|Default|Meaning
|--------|-------|-------|
|`BULLETTRAIN_ELIXIR_BG`|`magenta`|Background color
|`BULLETTRAIN_ELIXIR_FG`|`white`|Foreground color
|`BULLETTRAIN_ELIXIR_PREFIX`|`"💧"`|Prefix of the segment
### Go
|Variable|Default|Meaning

View File

@@ -28,6 +28,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
virtualenv
nvm
go
elixir
git
hg
cmd_exec_time
@@ -105,7 +106,7 @@ fi
# RUBY
if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then
BULLETTRAIN_RUBY_BG=magenta
BULLETTRAIN_RUBY_BG=red
fi
if [ ! -n "${BULLETTRAIN_RUBY_FG+1}" ]; then
BULLETTRAIN_RUBY_FG=white
@@ -125,6 +126,17 @@ if [ ! -n "${BULLETTRAIN_GO_PREFIX+1}" ]; then
BULLETTRAIN_GO_PREFIX="go"
fi
# ELIXIR
if [ ! -n "${BULLETTRAIN_ELIXIR_BG+1}" ]; then
BULLETTRAIN_ELIXIR_BG=magenta
fi
if [ ! -n "${BULLETTRAIN_ELIXIR_FG+1}" ]; then
BULLETTRAIN_ELIXIR_FG=white
fi
if [ ! -n "${BULLETTRAIN_ELIXIR_PREFIX+1}" ]; then
BULLETTRAIN_ELIXIR_PREFIX="💧"
fi
# DIR
if [ ! -n "${BULLETTRAIN_DIR_BG+1}" ]; then
BULLETTRAIN_DIR_BG=blue
@@ -457,6 +469,13 @@ prompt_ruby() {
fi
}
# ELIXIR
prompt_elixir() {
if command -v elixir > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_ELIXIR_BG $BULLETTRAIN_ELIXIR_FG $BULLETTRAIN_ELIXIR_PREFIX" $(elixir -v | tail -n 1 | awk '{print $2}')"
fi
}
# PERL
# PLENV: shows current PERL version active in the shell
prompt_perl() {