2017-11-14 14:36:22 +00:00
|
|
|
function tf_prompt_info() {
|
2020-02-08 02:28:18 +00:00
|
|
|
# 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-]}"
|
2017-11-07 15:45:25 +00:00
|
|
|
}
|
2020-09-30 08:50:33 +00:00
|
|
|
|
|
|
|
alias tf='terraform'
|