Commit 176376cb authored by Marc Cornellà's avatar Marc Cornellà
Browse files

kubectl: check for empty cache completion file

parent 5b717ab3
if (( $+commands[kubectl] )); then
__KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion"
if [[ ! -f $__KUBECTL_COMPLETION_FILE ]]; then
if [[ ! -f $__KUBECTL_COMPLETION_FILE || ! -s $__KUBECTL_COMPLETION_FILE ]]; then
kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE
fi
......@@ -151,7 +151,7 @@ alias kdpvc='kubectl describe pvc'
alias kdelpvc='kubectl delete pvc'
# Only run if the user actually has kubectl installed
if (( $+commands[kubectl] )); then
if (( ${+_comps[kubectl]} )); then
kj() { kubectl "$@" -o json | jq; }
kjx() { kubectl "$@" -o json | fx; }
ky() { kubectl "$@" -o yaml | yh; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment