Bladeren bron

zsh: update k8s custsh

Thomas Dy 4 jaren geleden
bovenliggende
commit
2dc8b63936
2 gewijzigde bestanden met toevoegingen van 6 en 5 verwijderingen
  1. 5 4
      .zsh/custom/k8s.zsh
  2. 1 1
      .zsh/prompt.zsh

+ 5 - 4
.zsh/custom/k8s.zsh

@@ -1,4 +1,5 @@
-KUBE_DIR=$HOME/.root/opt/kube
-export PATH=$PATH:$KUBE_DIR
-fpath+=$KUBE_DIR/completions
-compinit
+tmp_dir="$XDG_RUNTIME_DIR/kubeconfig"
+mkdir -p "$tmp_dir"
+tmp_config=$(mktemp -p "$tmp_dir")
+export KUBECONFIG="$tmp_config:$HOME/.kube/config"
+export IN_K8S="true"

+ 1 - 1
.zsh/prompt.zsh

@@ -14,7 +14,7 @@ local right=''
 if [ -n "$IN_NIX_SHELL" ]; then
   right+="$nix"
 fi
-if type kubectl > /dev/null; then
+if [ -n "$IN_K8S" ]; then
   right+="$k8s"
 fi
 local error='%F{red}%B%?%b%f'