diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
commit | 49edbf438ed690c76e6b2af80368c59404cf0167 (patch) | |
tree | 129b3adb2f5f39a1329a426a3b7d51ed2c2290c1 /plugins/terraform/terraform.plugin.zsh | |
parent | 1bc186dabe12b3d01b2257e82f3a104c48b8b3c7 (diff) | |
parent | 78c91ccbf99c77bd4d9cdb74279a40776721f66d (diff) | |
download | zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.gz zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.bz2 zsh-49edbf438ed690c76e6b2af80368c59404cf0167.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/terraform/terraform.plugin.zsh')
-rw-r--r-- | plugins/terraform/terraform.plugin.zsh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index 997241c9a..f224b79f0 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -1,11 +1,17 @@ function tf_prompt_info() { - # dont show 'default' workspace in home dir - [[ "$PWD" == ~ ]] && return - # check if in terraform dir - if [[ -d .terraform && -r .terraform/environment ]]; then - workspace=$(cat .terraform/environment) || return - echo "[${workspace}]" - fi + # dont show 'default' workspace in home dir + [[ "$PWD" != ~ ]] || return + # check if in terraform dir and file exists + [[ -d .terraform && -r .terraform/environment ]] || return + + local workspace="$(< .terraform/environment)" + echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}" } alias tf='terraform' +alias tfa='terraform apply' +alias tfd='terraform destroy' +alias tff='terraform fmt' +alias tfi='terraform init' +alias tfp='terraform plan' +alias tfv='terraform validate' |