Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
176376cb
Commit
176376cb
authored
Oct 17, 2020
by
Marc Cornellà
Browse files
kubectl: check for empty cache completion file
parent
5b717ab3
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/kubectl/kubectl.plugin.zsh
View file @
176376cb
if
((
$+
commands[kubectl]
))
;
then
__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
fi
...
...
@@ -151,7 +151,7 @@ alias kdpvc='kubectl describe pvc'
alias
kdelpvc
=
'kubectl delete pvc'
# Only run if the user actually has kubectl installed
if
((
$
+
command
s[kubectl]
))
;
then
if
((
$
{
+_comp
s[kubectl]
}
))
;
then
kj
()
{
kubectl
"
$@
"
-o
json | jq
;
}
kjx
()
{
kubectl
"
$@
"
-o
json | fx
;
}
ky
()
{
kubectl
"
$@
"
-o
yaml | yh
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment