Commit 2956e782 authored by Lorenzo Bolla's avatar Lorenzo Bolla
Browse files

Fix 6843 Cache kubectl completion script to file to speed up sourcing

parent a600ab4b
......@@ -2,8 +2,15 @@
#
# 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
source <(kubectl completion zsh)
source "$KUBECTL_COMPLETION_FILENAME"
fi
# This command is used ALOT both below and in daily life
......
Supports Markdown
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