terraform.plugin.zsh 545 B

1234567891011121314151617
  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 tfp='terraform plan'
  15. alias tfv='terraform validate'