Update super prompt to use docker context.
This commit is contained in:
parent
fb175ccd63
commit
d6f5dc9c34
|
@ -30,4 +30,9 @@ function sp_path {
|
||||||
echo $path
|
echo $path
|
||||||
}
|
}
|
||||||
|
|
||||||
export PS1="[${C_YELLOW}\u${C_NO}@${C_BLUE}${HOSTNAME}${C_NO}:${C_GREEN}\$(sp_path)${C_NO}] ${C_MAGENTA}\$(sp_git)${C_NO}\n${C_RED}\$ ${C_NO}"
|
function sp_docker_context {
|
||||||
|
local name=$(docker context inspect | grep Name | tr -d ' ' | sed -E "s/\"Name\":\"(.*)\",/\1/")
|
||||||
|
[ $name != 'default' ] && echo $name
|
||||||
|
}
|
||||||
|
|
||||||
|
export PS1="[${C_YELLOW}\u${C_NO}@${C_BLUE}${HOSTNAME}${C_NO}:${C_GREEN}\$(sp_path)${C_NO}] ${C_MAGENTA}\$(sp_git)${C_NO} ${C_GREEN}\$(sp_docker_context)${C_NO} ${C_RED}\$(echo -n \$DOCKER_MACHINE_NAME)${C_NO} \n${C_RED}\$ ${C_NO}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user