Skip to content

Instantly share code, notes, and snippets.

@jamesbeedy
Created April 5, 2018 00:47
Show Gist options
  • Save jamesbeedy/7a2226b7ab097e7e329cb45c54c5097d to your computer and use it in GitHub Desktop.
Save jamesbeedy/7a2226b7ab097e7e329cb45c54c5097d to your computer and use it in GitHub Desktop.
show_juju_env
#!/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