Show kubeconfig in prompt
This commit is contained in:
@@ -94,6 +94,25 @@ if [ $? -eq 0 ]; then
|
||||
alias dcd="docker-compose down"
|
||||
fi
|
||||
|
||||
command -v kubectl > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
# Sets the kube config
|
||||
kube() {
|
||||
local kube_config=$HOME/.kubes/$1/config
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 error: kube expects a single argument
|
||||
return 1
|
||||
elif [ ! -f $kube_config ]; then
|
||||
echo >&2 error: no such kube config: $kube_config
|
||||
return 1
|
||||
else
|
||||
export KUBECONFIG=$kube_config
|
||||
fi
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
# change to git directory
|
||||
cdg() {
|
||||
local newdir
|
||||
|
||||
Reference in New Issue
Block a user