1 function tf_prompt_info() {
2 # dont show 'default' workspace in home dir
3 [[ "$PWD" != ~ ]] || return
4 # check if in terraform dir and file exists
5 [[ -d .terraform && -r .terraform/environment ]] || return
7 local workspace="$(< .terraform/environment)"
8 echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}"
12 alias tfa='terraform apply'
13 alias tfd='terraform destroy'
14 alias tff='terraform fmt'
15 alias tfi='terraform init'
16 alias tfo='terraform output'
17 alias tfp='terraform plan'
18 alias tfv='terraform validate'