Last active
September 16, 2020 05:01
-
-
Save gregswift/0105ca5c6233c01146dcc6e9041c32d2 to your computer and use it in GitHub Desktop.
terraform_ps1.bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source terraform_ps1.sh | |
# Obviously manage your PS1 however you are gonna mange it... this is just an example | |
PS1="\u@\h \W \$(__terraform_ps1) $" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pull this from https://gist.github.com/gregswift/11ee552bc443e1051eef9454c833c07f | |
source colorize.bashrc | |
# In our repos we bootstrap the repos pulling terraform into the directory | |
# Technically you dont need to include this in the conditional checks | |
TF_PATH=./terraform | |
function __terraform_ps1() | |
{ | |
if [ -x ${TF_PATH} ] && [ -d .terraform ]; then | |
workspace="$(command ${TF_PATH} workspace show 2>/dev/null)" | |
echo "($(colorize_tier ${workspace}))" | |
fi | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment