Created
April 5, 2018 00:47
-
-
Save jamesbeedy/7a2226b7ab097e7e329cb45c54c5097d to your computer and use it in GitHub Desktop.
show_juju_env
This file contains hidden or 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
#!/bin/bash | |
# | |
# sudo apt install jq | |
# add this to ~/.bashrc | |
# source ~/.bashrc | |
function show_juju_env { | |
local model | |
local controller | |
model=`juju whoami --format json | jq -r '.["model"]'` | |
controller=`juju whoami --format json | jq -r '.["controller"]'` | |
printf "%s:%s" "$controller" "$model" | |
} | |
export PS1="[\[\e\[\033[01;32m\]\$(show_juju_env)\[\e[0m\]]\n${PS1}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment