Add terraform prompt
This commit is contained in:
parent
1f1390148a
commit
815c19fde8
|
@ -152,6 +152,17 @@ prompt_virtualenv() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Terraform: current terraform workspace
|
||||||
|
prompt_tf() {
|
||||||
|
# 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
|
||||||
|
prompt_segment magenta black "[${workspace}]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Status:
|
# Status:
|
||||||
# - was there an error
|
# - was there an error
|
||||||
# - am I root
|
# - am I root
|
||||||
|
@ -179,6 +190,7 @@ build_prompt() {
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
|
prompt_tf
|
||||||
prompt_git
|
prompt_git
|
||||||
prompt_end
|
prompt_end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue