From f157e347027a685ccd1b6cc522eb3ce68b4ebc5b Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 4 Jul 2019 11:56:19 -0300 Subject: [PATCH 1/2] add support to terraform --- README.md | 7 +++++++ bullet-train.zsh-theme | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/README.md b/README.md index 629483d..828a32a 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,13 @@ most of the code was later erased and its now more closely related to [Agnoster](https://gist.github.com/agnoster/3712874). Below is a `git summary` of the project: +### Terraform +|Variable|Default|Meaning +|--------|-------|-------| +|`BULLETTRAIN_TERRAFORM_BG`|`magenta`|Background color +|`BULLETTRAIN_TERRAFORM_FG`|`white`|Foreground color +|`BULLETTRAIN_TERRAFORM_PREFIX`|`"ƒ"`|Prefix + ``` 156 Caio Gondim 33 Jérémy Romey diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index c31cc96..e178309 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -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="\$" @@ -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 @@ -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 From 30e0d49ccc6d11c5fcbf1692ed5d29ed2ac83b77 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 4 Jul 2019 12:03:07 -0300 Subject: [PATCH 2/2] fix readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 828a32a..d1c2417 100644 --- a/README.md +++ b/README.md @@ -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) @@ -287,13 +294,6 @@ most of the code was later erased and its now more closely related to [Agnoster](https://gist.github.com/agnoster/3712874). Below is a `git summary` of the project: -### Terraform -|Variable|Default|Meaning -|--------|-------|-------| -|`BULLETTRAIN_TERRAFORM_BG`|`magenta`|Background color -|`BULLETTRAIN_TERRAFORM_FG`|`white`|Foreground color -|`BULLETTRAIN_TERRAFORM_PREFIX`|`"ƒ"`|Prefix - ``` 156 Caio Gondim 33 Jérémy Romey