mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-11 00:10:08 +00:00
Fix 6843 Cache kubectl completion script to file to speed up sourcing
This commit is contained in:
parent
a600ab4b85
commit
2956e7820e
1 changed files with 8 additions and 1 deletions
|
@ -2,8 +2,15 @@
|
||||||
#
|
#
|
||||||
# Author: https://github.com/pstadler
|
# Author: https://github.com/pstadler
|
||||||
|
|
||||||
|
KUBECTL_COMPLETION_FILENAME="$TMPPREFIX-kubectl-completion-zsh"
|
||||||
|
|
||||||
|
if [[ ! -f "$KUBECTL_COMPLETION_FILENAME" ]]
|
||||||
|
then
|
||||||
|
kubectl completion zsh > "$KUBECTL_COMPLETION_FILENAME"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $commands[kubectl] ]; then
|
if [ $commands[kubectl] ]; then
|
||||||
source <(kubectl completion zsh)
|
source "$KUBECTL_COMPLETION_FILENAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This command is used ALOT both below and in daily life
|
# This command is used ALOT both below and in daily life
|
||||||
|
|
Loading…
Reference in a new issue