mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-20 19:31:58 +00:00
feat(terraform): add PREFIX and SUFFIX settings to tf_prompt_info
(#8605)
Closes #8605
This commit is contained in:
parent
02eb548d5a
commit
0e399d47b9
1 changed files with 7 additions and 7 deletions
|
@ -1,11 +1,11 @@
|
|||
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'
|
||||
|
|
Loading…
Reference in a new issue