Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ The git prompt can be disabled for a specific repository by setting a git config
|`BULLETTRAIN_EXEC_TIME_BG`|`yellow`|Background color
|`BULLETTRAIN_EXEC_TIME_FG`|`black`|Foreground color

### Terraform
|Variable|Default|Meaning
|--------|-------|-------|
|`BULLETTRAIN_TERRAFORM_BG`|`magenta`|Background color
|`BULLETTRAIN_TERRAFORM_FG`|`white`|Foreground color
|`BULLETTRAIN_TERRAFORM_PREFIX`|`"ƒ"`|Prefix

## Wiki

- [FAQ](https://github.com/caiogondim/bullet-train-oh-my-zsh-theme/wiki/FAQ)
Expand Down
20 changes: 20 additions & 0 deletions bullet-train.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
elixir
git
hg
terraform
cmd_exec_time
)
fi



# PROMPT
if [ ! -n "${BULLETTRAIN_PROMPT_CHAR+1}" ]; then
BULLETTRAIN_PROMPT_CHAR="\$"
Expand Down Expand Up @@ -321,6 +324,16 @@ if [ ! -n "${BULLETTRAIN_EXEC_TIME_FG+1}" ]; then
BULLETTRAIN_EXEC_TIME_FG=black
fi

# TERRAFORM
if [ ! -n "${BULLETTRAIN_TERRAFORM_BG+1}" ]; then
BULLETTRAIN_TERRAFORM_BG=magenta
fi
if [ ! -n "${BULLETTRAIN_TERRAFORM_FG+1}" ]; then
BULLETTRAIN_TERRAFORM_FG=white
fi
if [ ! -n "${BULLETTRAIN_TERRAFORM_PREFIX+1}" ]; then
BULLETTRAIN_TERRAFORM_PREFIX="ƒ"
fi

# ------------------------------------------------------------------------------
# SEGMENT DRAWING
Expand Down Expand Up @@ -612,6 +625,13 @@ prompt_time() {
fi
}

prompt_terraform() {
local workspace="$(tf_prompt_info)"
if [[ -n "$workspace" ]]; then
prompt_segment $BULLETTRAIN_TERRAFORM_BG $BULLETTRAIN_TERRAFORM_FG "$BULLETTRAIN_TERRAFORM_PREFIX $workspace"
fi
}

# Status:
# - was there an error
# - am I root
Expand Down