Commit d12c2ea4 authored by Maciej Lasyk's avatar Maciej Lasyk Committed by Robby Russell
Browse files

Plugins: Terraform (#6373)

Expanded Terraform plugin with function that can be used to show workspace name in the zsh prompt
parent 46062e25
......@@ -9,3 +9,13 @@ Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely a
### Usage
* Type `terraform` into your prompt and hit `TAB` to see available completion options
### Expanding ZSH prompt with current Terraform workspace name
If you want to get current Terraform workspace name in your ZSH prompt open
your .zsh-theme file and in a choosen place insert:
```
$FG[045]\
$(terraform_prompt_info)\
```
function terraform_prompt_info() {
# check if in terraform dir
if [ -d .terraform ]; then
workspace=$(terraform workspace show 2> /dev/null) || return
echo "[${workspace}]"
fi
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment