mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-12 21:39:48 +01:00
kubectl: check for empty cache completion file
This commit is contained in:
parent
5b717ab3e4
commit
176376cbc0
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
if (( $+commands[kubectl] )); then
|
if (( $+commands[kubectl] )); then
|
||||||
__KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion"
|
__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
|
kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ alias kdpvc='kubectl describe pvc'
|
||||||
alias kdelpvc='kubectl delete pvc'
|
alias kdelpvc='kubectl delete pvc'
|
||||||
|
|
||||||
# Only run if the user actually has kubectl installed
|
# Only run if the user actually has kubectl installed
|
||||||
if (( $+commands[kubectl] )); then
|
if (( ${+_comps[kubectl]} )); then
|
||||||
kj() { kubectl "$@" -o json | jq; }
|
kj() { kubectl "$@" -o json | jq; }
|
||||||
kjx() { kubectl "$@" -o json | fx; }
|
kjx() { kubectl "$@" -o json | fx; }
|
||||||
ky() { kubectl "$@" -o yaml | yh; }
|
ky() { kubectl "$@" -o yaml | yh; }
|
||||||
|
|
Loading…
Reference in a new issue