terraform.plugin.zsh 574 B

123456789101112131415161718
  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
  6. local workspace="$(< .terraform/environment)"
  7. echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}"
  8. }
  9. alias tf='terraform'
  10. alias tfa='terraform apply'
  11. alias tfd='terraform destroy'
  12. alias tff='terraform fmt'
  13. alias tfi='terraform init'
  14. alias tfo='terraform output'
  15. alias tfp='terraform plan'
  16. alias tfv='terraform validate'