terraform.plugin.zsh 297 Bytes
Newer Older
1
function tf_prompt_info() {
2
3
    # dont show 'default' workspace in home dir
    [[ "$PWD" == ~ ]] && return
Maciej Lasyk's avatar
Maciej Lasyk committed
4
5
6
7
8
9
    # check if in terraform dir
    if [ -d .terraform ]; then
      workspace=$(terraform workspace show 2> /dev/null) || return
      echo "[${workspace}]"
    fi
}
10
11

alias tf='terraform'