fix(comp): tail cannot open +2 for reading

Signed-off-by: Frank Lin PIAT <fpiat@klabs.be>
(cherry picked from commit 2eab781b35)
release-3.0
Frank Lin PIAT 6 years ago committed by Matt Farina
parent 4771f256cd
commit 50a647728f
No known key found for this signature in database
GPG Key ID: 9436E80BFBA46909

@ -69,7 +69,7 @@ __helm_override_flags_to_kubectl_flags()
__helm_get_repos() __helm_get_repos()
{ {
eval $(__helm_binary_name) repo list 2>/dev/null | tail +2 | cut -f1 eval $(__helm_binary_name) repo list 2>/dev/null | \tail -n +2 | \cut -f1
} }
__helm_get_contexts() __helm_get_contexts()
@ -236,7 +236,7 @@ __helm_list_plugins()
__helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
local out local out
# Use eval in case helm_binary_name contains a variable (e.g., $HOME/bin/h3) # Use eval in case helm_binary_name contains a variable (e.g., $HOME/bin/h3)
if out=$(eval $(__helm_binary_name) plugin list 2>/dev/null | tail +2 | cut -f1); then if out=$(eval $(__helm_binary_name) plugin list 2>/dev/null | \tail -n +2 | \cut -f1); then
COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
fi fi
} }

Loading…
Cancel
Save