1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-19 02:41:57 +00:00

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

Closes #8605
This commit is contained in:
Karn Saheb 2020-02-07 21:28:18 -05:00 committed by Marc Cornellà
parent 02eb548d5a
commit 0e399d47b9
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B

View file

@ -1,11 +1,11 @@
function tf_prompt_info() { function tf_prompt_info() {
# dont show 'default' workspace in home dir # dont show 'default' workspace in home dir
[[ "$PWD" == ~ ]] && return [[ "$PWD" != ~ ]] || return
# check if in terraform dir # check if in terraform dir and file exists
if [[ -d .terraform && -r .terraform/environment ]]; then [[ -d .terraform && -r .terraform/environment ]] || return
workspace=$(cat .terraform/environment) || return
echo "[${workspace}]" local workspace="$(< .terraform/environment)"
fi echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}"
} }
alias tf='terraform' alias tf='terraform'