ohmyzsh/plugins/terraform/terraform.plugin.zsh
Vlad Korolev 0ab87c26c1
fix(terraform): use faster method to get workspace (#9709)
Also add tf_prompt_info to the list of prompt functions so theme writers are aware of it
2021-03-08 10:46:42 +01:00

11 lines
318 B
Bash

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
}
alias tf='terraform'