mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-06-04 21:30:11 +00:00
Wrap context names in single quotes to prevent completion script to fail (#316)
This commit is contained in:
parent
33212062fb
commit
e449e739f8
@ -3,7 +3,9 @@
|
||||
local KUBECTX="${HOME}/.kube/kubectx"
|
||||
PREV=""
|
||||
|
||||
local all_contexts="$(kubectl config get-contexts --output='name')"
|
||||
local context_array=("${(@f)$(kubectl config get-contexts --output='name')}")
|
||||
local all_contexts=(\'${^context_array}\')
|
||||
|
||||
if [ -f "$KUBECTX" ]; then
|
||||
# show '-' only if there's a saved previous context
|
||||
local PREV=$(cat "${KUBECTX}")
|
||||
|
Loading…
Reference in New Issue
Block a user