1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-30 08:11:58 +00:00
ohmyzsh/plugins/terraform/terraform.plugin.zsh
Tristan Escalada 9e14387408 terraform: disable terraform prompt in $HOME (#7227)
In the home directory there is a .terraform folder for modules but it is most likely not
an actual directory of terraform scripts. Therefore, this patch disables checking for workspace in the home directory.
2018-10-05 20:56:56 +02:00

9 lines
275 B
Bash

function tf_prompt_info() {
# dont show 'default' workspace in home dir
[[ "$PWD" == ~ ]] && return
# check if in terraform dir
if [ -d .terraform ]; then
workspace=$(terraform workspace show 2> /dev/null) || return
echo "[${workspace}]"
fi
}