Unverified Commit 0e399d47 authored by Karn Saheb's avatar Karn Saheb Committed by Marc Cornellà

feat(terraform): add PREFIX and SUFFIX settings to `tf_prompt_info` (#8605)

Closes #8605
parent 02eb548d
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'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment