e9348575371aa8ec8811356d997942559c026d07

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(kubectl): support completion for snap installs (#10727)

Diff

 1diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
 2index eed5727d1b0d9589ae4868f526a904c4116363c9..89efeaca520c6fe7ab588b50abbfe8c3993b5286 100644
 3--- a/plugins/kubectl/kubectl.plugin.zsh
 4+++ b/plugins/kubectl/kubectl.plugin.zsh
 5@@ -11,11 +11,11 @@ if (( $+commands[kubectl] )); then
 6   # If the completion file does not exist, generate it and then source it
 7   # Otherwise, source it and regenerate in the background
 8   if [[ ! -f "$ZSH_CACHE_DIR/completions/_kubectl" ]]; then
 9-    kubectl completion zsh >| "$ZSH_CACHE_DIR/completions/_kubectl"
10+    kubectl completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubectl" >/dev/null
11     source "$ZSH_CACHE_DIR/completions/_kubectl"
12   else
13     source "$ZSH_CACHE_DIR/completions/_kubectl"
14-    kubectl completion zsh >| "$ZSH_CACHE_DIR/completions/_kubectl" &|
15+    kubectl completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubectl" >/dev/null &|
16   fi
17 fi
18