mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 03:40:41 +01:00
Add Kubernetes Context (#257)
This commit is contained in:
@@ -139,6 +139,17 @@ if [ ! -n "${BULLETTRAIN_GO_PREFIX+1}" ]; then
|
||||
BULLETTRAIN_GO_PREFIX="go"
|
||||
fi
|
||||
|
||||
# Kubernetes Context
|
||||
if [ ! -n "${BULLETTRAIN_KCTX_BG+1}" ]; then
|
||||
BULLETTRAIN_KCTX_BG=yellow
|
||||
fi
|
||||
if [ ! -n "${BULLETTRAIN_KCTX_FG+1}" ]; then
|
||||
BULLETTRAIN_KCTX_FG=white
|
||||
fi
|
||||
if [ ! -n "${BULLETTRAIN_KCTX_PREFIX+1}" ]; then
|
||||
BULLETTRAIN_KCTX_PREFIX="⎈"
|
||||
fi
|
||||
|
||||
# ELIXIR
|
||||
if [ ! -n "${BULLETTRAIN_ELIXIR_BG+1}" ]; then
|
||||
BULLETTRAIN_ELIXIR_BG=magenta
|
||||
@@ -518,6 +529,18 @@ prompt_go() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Kubernetes Context
|
||||
prompt_kctx() {
|
||||
if [[ ! -n $BULLETTRAIN_KCTX_KCONFIG ]]; then
|
||||
return
|
||||
fi
|
||||
if command -v kubectl > /dev/null 2>&1; then
|
||||
if [[ -f $BULLETTRAIN_KCTX_KCONFIG ]]; then
|
||||
prompt_segment $BULLETTRAIN_KCTX_BG $BULLETTRAIN_KCTX_FG $BULLETTRAIN_KCTX_PREFIX" $(cat $BULLETTRAIN_KCTX_KCONFIG|grep current-context| awk '{print $2}')"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Virtualenv: current working virtualenv
|
||||
prompt_virtualenv() {
|
||||
local virtualenv_path="$VIRTUAL_ENV"
|
||||
|
||||
Reference in New Issue
Block a user